Réécriture complète en Typescript
This commit is contained in:
15
src/commands/player/previous.ts
Executable file
15
src/commands/player/previous.ts
Executable file
@@ -0,0 +1,15 @@
|
||||
import { SlashCommandBuilder, ChatInputCommandInteraction } from 'discord.js'
|
||||
import { useHistory } from 'discord-player'
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('previous')
|
||||
.setDescription('Joue la musique précédente.'),
|
||||
async execute(interaction: ChatInputCommandInteraction) {
|
||||
let history = useHistory(interaction.guild?.id ?? '')
|
||||
if (!history) return await interaction.reply('Il n\'y a pas d\'historique de musique !')
|
||||
|
||||
await history.previous()
|
||||
return await interaction.reply('Musique précédente jouée !')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user