Merge pull request #700 from Klairm/patch-1

fix(example): message is not defined
This commit is contained in:
Andromeda 2021-08-15 08:23:43 +05:45 committed by GitHub
commit e9d77db609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,7 @@ client.on("interactionCreate", async (interaction) => {
if (!interaction.member.voice.channelId) return await interaction.reply({ content: "You are not in a voice channel!", empheral: true }); if (!interaction.member.voice.channelId) return await interaction.reply({ content: "You are not in a voice channel!", empheral: true });
if (interaction.guild.me.voice.channelId && interaction.member.voice.channelId !== interaction.guild.me.voice.channelId) return await interaction.reply({ content: "You are not in my voice channel!", empheral: true }); if (interaction.guild.me.voice.channelId && interaction.member.voice.channelId !== interaction.guild.me.voice.channelId) return await interaction.reply({ content: "You are not in my voice channel!", empheral: true });
const query = interaction.options.get("query").value; const query = interaction.options.get("query").value;
const queue = player.createQueue(message.guild, { const queue = player.createQueue(interaction.guild, {
metadata: { metadata: {
channel: interaction.channel channel: interaction.channel
} }
@ -119,7 +119,7 @@ client.on("interactionCreate", async (interaction) => {
return await interaction.reply({ content: "Could not join your voice channel!", empheral: true }); return await interaction.reply({ content: "Could not join your voice channel!", empheral: true });
} }
await interaction.defer(); await interaction.deferReply();
const track = await player.search(query, { const track = await player.search(query, {
requestedBy: message.author requestedBy: message.author
}).then(x => x.tracks[1]); }).then(x => x.tracks[1]);