29 lines
716 B
TypeScript
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
|
|
}
|