added skip

This commit is contained in:
Patryk Koreń
2025-12-29 18:14:59 +01:00
parent 03c2d35bf0
commit ac5f65844d
3 changed files with 42 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import ping from "./ping"
import play from "./play"
import queue from "./queue"
import resume from "./resume"
import skip from "./skip"
import stop from "./stop"
export const commands: { [key: string]: Command } = {
@@ -16,5 +17,6 @@ export const commands: { [key: string]: Command } = {
resume,
stop,
pause,
skip,
}

27
src/commands/skip.ts Normal file
View 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
}