diff options
| author | Max Isom <[email protected]> | 2021-12-12 20:31:55 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2021-12-12 20:31:55 -0500 |
| commit | d2ab10a13ab22d21f3e52106f355fc8272e11651 (patch) | |
| tree | 302db740df42736079ac83aeb1d8dc2165d70da9 | |
| parent | dcb1351791e23165b23a8b549aabbb38294f55a5 (diff) | |
| download | muse-d2ab10a13ab22d21f3e52106f355fc8272e11651.tar.xz muse-d2ab10a13ab22d21f3e52106f355fc8272e11651.zip | |
Edit interaction reply if necessary for error messages
| -rw-r--r-- | src/bot.ts | 7 | ||||
| -rw-r--r-- | src/commands/play.ts | 2 |
2 files changed, 7 insertions, 2 deletions
@@ -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')) |
