Stop was advancing the queue, history overwrote the day file, and slash commands often never replied; soundboard clips now mix on top of the current track. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
680 B
TypeScript
29 lines
680 B
TypeScript
import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
|
|
import { stop_playback } from '../playback';
|
|
import { player } from '../main';
|
|
|
|
|
|
const name = "stop"
|
|
|
|
function register() {
|
|
return new SlashCommandBuilder()
|
|
.setName(name)
|
|
.setDescription('stop playback')
|
|
}
|
|
|
|
async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
|
|
try {
|
|
stop_playback(player)
|
|
await interaction.reply('Zatrzymane, kolejka wyczyszczona')
|
|
} catch (error) {
|
|
console.error(error);
|
|
await interaction.reply('Coś poszło nie tak :/');
|
|
}
|
|
}
|
|
|
|
export default {
|
|
name,
|
|
register,
|
|
execute
|
|
}
|