From 3430156816a149c6f50f540cf22ca379ef955711 Mon Sep 17 00:00:00 2001 From: k4mien Date: Wed, 24 Jan 2024 16:58:08 +0100 Subject: [PATCH] changed message send to await fun --- src/commands/clear.js | 2 +- src/commands/join.js | 2 +- src/commands/loop.js | 8 ++++---- src/commands/pause.js | 2 +- src/commands/resume.js | 2 +- src/commands/skip.js | 3 +-- src/commands/skipto.js | 9 ++++----- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/commands/clear.js b/src/commands/clear.js index 4b49714..aa80990 100644 --- a/src/commands/clear.js +++ b/src/commands/clear.js @@ -52,7 +52,7 @@ module.exports = { if (player.queue.tracks.length) { await player.queue.splice(0, player.queue.tracks.length) - return message.channel.send({ + await message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') diff --git a/src/commands/join.js b/src/commands/join.js index a2b0ca8..a2005fe 100644 --- a/src/commands/join.js +++ b/src/commands/join.js @@ -61,7 +61,7 @@ module.exports = { applyVolumeAsFilter: false }) await newPlayer.connect() - return message.channel.send({ + await message.channel.send({ embeds: [ new EmbedBuilder().setColor('Purple').setDescription(`Joined ${voiceChannel}!`) ] diff --git a/src/commands/loop.js b/src/commands/loop.js index 379d411..b426ef4 100644 --- a/src/commands/loop.js +++ b/src/commands/loop.js @@ -22,14 +22,14 @@ module.exports = { }) } - if (!player) { + if (!player) { return message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') .setDescription('Bot is not connected!') ] - }) + }) } if (player?.voiceChannelId !== voiceChannelId) { @@ -42,14 +42,14 @@ module.exports = { }) } - if ((!player.playing && !player.paused) || !player.queue.current) { + if ((!player.playing && !player.paused) || !player.queue.current) { return message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') .setDescription('There is nothing in the queue right now!') ] - }) + }) } if (!args[0]) { diff --git a/src/commands/pause.js b/src/commands/pause.js index 5ca951b..57a54e3 100644 --- a/src/commands/pause.js +++ b/src/commands/pause.js @@ -61,7 +61,7 @@ module.exports = { }) } else { await player.pause() - return message.channel.send({ + await message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') diff --git a/src/commands/resume.js b/src/commands/resume.js index 428ccd6..388d5a5 100644 --- a/src/commands/resume.js +++ b/src/commands/resume.js @@ -61,7 +61,7 @@ module.exports = { }) } else { await player.resume() - return message.channel.send({ + await message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') diff --git a/src/commands/skip.js b/src/commands/skip.js index 6e226cd..5968c64 100644 --- a/src/commands/skip.js +++ b/src/commands/skip.js @@ -53,11 +53,10 @@ module.exports = { } if (!player.queue.tracks.length) { - // await player.play({encodedTrack: null}); await player.stopPlaying() } else { await player.skip() - return message.channel.send({ + await message.channel.send({ embeds: [ new EmbedBuilder().setColor('Purple').setDescription(':track_next: Song skipped!') ] diff --git a/src/commands/skipto.js b/src/commands/skipto.js index 2871817..0dd6783 100644 --- a/src/commands/skipto.js +++ b/src/commands/skipto.js @@ -22,14 +22,14 @@ module.exports = { }) } - if (!player) { + if (!player) { return message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') .setDescription('Bot is not connected!') ] - }) + }) } if (player?.voiceChannelId !== voiceChannelId) { @@ -42,14 +42,14 @@ module.exports = { }) } - if ((!player.playing && !player.paused) || !player.queue.current) { + if ((!player.playing && !player.paused) || !player.queue.current) { return message.channel.send({ embeds: [ new EmbedBuilder() .setColor('Purple') .setDescription('There is nothing in the queue right now!') ] - }) + }) } if (!args[0]) { @@ -85,7 +85,6 @@ module.exports = { } if (!player.queue.tracks.length) { - // await player.play({encodedTrack: null}); await player.stopPlaying() } else { await message.channel.send({