aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-12-12 20:31:55 -0500
committerMax Isom <[email protected]>2021-12-12 20:31:55 -0500
commitd2ab10a13ab22d21f3e52106f355fc8272e11651 (patch)
tree302db740df42736079ac83aeb1d8dc2165d70da9 /src
parentdcb1351791e23165b23a8b549aabbb38294f55a5 (diff)
downloadmuse-d2ab10a13ab22d21f3e52106f355fc8272e11651.tar.xz
muse-d2ab10a13ab22d21f3e52106f355fc8272e11651.zip
Edit interaction reply if necessary for error messages
Diffstat (limited to 'src')
-rw-r--r--src/bot.ts7
-rw-r--r--src/commands/play.ts2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 09e9833..01616ff 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -62,7 +62,12 @@ export default class {
}
} catch (error: unknown) {
debug(error);
- await interaction.reply({content: errorMsg(error as Error), ephemeral: true});
+
+ if (interaction.replied || interaction.deferred) {
+ await interaction.editReply(errorMsg('something went wrong'));
+ } else {
+ await interaction.reply({content: errorMsg(error as Error), ephemeral: true});
+ }
}
});
diff --git a/src/commands/play.ts b/src/commands/play.ts
index 9a79819..8e1616b 100644
--- a/src/commands/play.ts
+++ b/src/commands/play.ts
@@ -15,7 +15,7 @@ import GetSongs from '../services/get-songs.js';
export default class implements Command {
public readonly slashCommand = new SlashCommandBuilder()
.setName('play')
- .setDescription('Play a song')
+ .setDescription('Play a song or resume playback')
.addStringOption(option => option
.setName('query')
.setDescription('YouTube URL, Spotify URL, or search query'))