Files
dj-spangebob/src/commands/skip.ts
2026-01-03 21:02:26 +01:00

29 lines
716 B
TypeScript

import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
import { skip_song } from '../playback';
import { msg_skipped } from '../messages';
const name = "skip"
function register() {
return new SlashCommandBuilder()
.setName(name)
.setDescription('skip song')
}
async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
try {
await interaction.deferReply()
const skipped = skip_song()
await interaction.editReply(msg_skipped(skipped));
} catch (error) {
console.error(error);
await interaction.reply('Coś poszło nie tak :/');
}
}
export default {
name,
register,
execute
}