all repos — simple-discord-music-bot @ 11618de1e7166cedd87a510b2bab1d52ff1c5744

A Discord bot making use of discord.js and play-yt.

src/commands/skip.ts (view raw)

 1import { SlashCommandBuilder, ChatInputCommandInteraction } from 'discord.js';
 2import { getChannel, skipMusic } from '../functions/music';
 3
 4module.exports = {
 5    data: new SlashCommandBuilder()
 6        .setName('skip')
 7        .setDescription('Skip current track.'),
 8
 9    async execute(interaction: ChatInputCommandInteraction) {
10        const channel = await getChannel(interaction);
11        if (typeof channel == 'string')
12            return await interaction.reply({ content: channel, ephemeral: true });
13
14        const result = await skipMusic();
15        return await interaction.reply({ content: 'Skipped.' });
16        //return await interaction.reply({ content: 'Error: couldn\'t skip.', ephemeral: true });
17    },
18};