Ajout /lyrics, /papa et /parle + Fix /crack
This commit is contained in:
28
commands/global/papa.js
Executable file
28
commands/global/papa.js
Executable file
@@ -0,0 +1,28 @@
|
||||
const { SlashCommandBuilder } = require('discord.js')
|
||||
const { getVoiceConnection, joinVoiceChannel } = require('@discordjs/voice')
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('papa')
|
||||
.setDescription('Si papa m\'appelle, je le rejoins !'),
|
||||
async execute(interaction) {
|
||||
if (interaction.user.id !== '223831938346123275') return interaction.reply({ content: 'T\'es pas mon père, dégage !' })
|
||||
|
||||
let botChannel = interaction.guild.members.me.voice.channel
|
||||
let papaChannel = interaction.member.voice.channel
|
||||
|
||||
if (!papaChannel && botChannel) {
|
||||
getVoiceConnection(botChannel.guild.id).destroy()
|
||||
return interaction.reply({ content: 'Je quitte le vocal, papa !' })
|
||||
}
|
||||
else if (!botChannel || botChannel.id !== papaChannel.id) {
|
||||
joinVoiceChannel({
|
||||
channelId: papaChannel.id,
|
||||
guildId: papaChannel.guild.id,
|
||||
adapterCreator: papaChannel.guild.voiceAdapterCreator,
|
||||
})
|
||||
return interaction.reply({ content: 'Je rejoins ton vocal, papa !' })
|
||||
}
|
||||
else return interaction.reply({ content: 'Je suis déjà dans ton vocal, papa !' })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user