added skip
This commit is contained in:
27
src/commands/skip.ts
Normal file
27
src/commands/skip.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
|
||||
import { skip_song } from '../playback';
|
||||
|
||||
const name = "skip"
|
||||
|
||||
function register() {
|
||||
return new SlashCommandBuilder()
|
||||
.setName(name)
|
||||
.setDescription('skip song')
|
||||
}
|
||||
|
||||
async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
|
||||
try {
|
||||
await interaction.deferReply()
|
||||
skip_song()
|
||||
await interaction.editReply('skipped');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply('Coś poszło nie tak :/');
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name,
|
||||
register,
|
||||
execute
|
||||
}
|
||||
Reference in New Issue
Block a user