mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 09:15:29 +01:00
Edit interaction reply if necessary for error messages
This commit is contained in:
parent
dcb1351791
commit
d2ab10a13a
|
@ -62,7 +62,12 @@ export default class {
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
debug(error);
|
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});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import GetSongs from '../services/get-songs.js';
|
||||||
export default class implements Command {
|
export default class implements Command {
|
||||||
public readonly slashCommand = new SlashCommandBuilder()
|
public readonly slashCommand = new SlashCommandBuilder()
|
||||||
.setName('play')
|
.setName('play')
|
||||||
.setDescription('Play a song')
|
.setDescription('Play a song or resume playback')
|
||||||
.addStringOption(option => option
|
.addStringOption(option => option
|
||||||
.setName('query')
|
.setName('query')
|
||||||
.setDescription('YouTube URL, Spotify URL, or search query'))
|
.setDescription('YouTube URL, Spotify URL, or search query'))
|
||||||
|
|
Loading…
Reference in a new issue