music: fix createMessage calls

This commit is contained in:
Cynthia Foxwell 2022-12-10 14:55:39 -07:00
parent e1719fb12c
commit 8d47c64fd8

View file

@ -175,9 +175,9 @@ async function createVoiceConnection(guild_id, voice_id, text_id) {
await hf.bot.guilds
.get(guild_id)
.channels.get(text_id)
.createMessage(
":musical_note: Queue is empty, leaving voice channel."
);
.createMessage({
content: ":musical_note: Queue is empty, leaving voice channel.",
});
}
state.player.off(AudioPlayerStatus.Idle, state.onEnd);
voiceStorage.delete(guild_id);
@ -217,9 +217,9 @@ async function enqueue({
try {
info = await ytdl.getInfo(url, {});
} catch (err) {
await textChannel.createMessage(
`:warning: Failed to get metadata: \`\`\`\n${err}\n\`\`\``
);
await textChannel.createMessage({
content: `:warning: Failed to get metadata: \`\`\`\n${err}\n\`\`\``,
});
}
title = info?.videoDetails?.title;
@ -261,9 +261,9 @@ async function enqueue({
try {
info = await ffprobe(url).then((obj) => obj.format);
} catch (err) {
textChannel.createMessage(
`:warning: Failed to get metadata: \`\`\`\n${err}\n\`\`\``
);
textChannel.createMessage({
content: `:warning: Failed to get metadata: \`\`\`\n${err}\n\`\`\``,
});
}
stream = !info.duration;
@ -337,9 +337,9 @@ async function enqueue({
}
} else {
if (!media) {
textChannel.createMessage(
`:warning: No usable media was found for \`${url}\`. May possibly be due to region restrictions or paywalls.`
);
textChannel.createMessage({
content: `:warning: No usable media was found for \`${url}\`. May possibly be due to region restrictions or paywalls.`,
});
return;
}