Add an overlay soundboard and fix playback command bugs.

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>
This commit is contained in:
Patryk Koreń
2026-09-13 17:03:02 +02:00
parent 2eb8d25a2d
commit ad87d3fbb8
19 changed files with 708 additions and 126 deletions

View File

@@ -1,7 +1,7 @@
import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
import { connectToChannelByInteraction } from '../util/helpers';
import { requestSong } from '../playback';
import { getPlayMsg, msg_downloading, msg_play, msg_searching } from '../messages';
import { msg_downloading, msg_play, msg_searching } from '../messages';
import { search, spotifyToYouTube } from '../util/downloader';
const name = "play"
@@ -18,7 +18,7 @@ function register() {
async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
try {
await interaction.deferReply()
connectToChannelByInteraction(interaction)
await connectToChannelByInteraction(interaction)
const input = interaction.options.getString("url")!;
let url: string;
@@ -36,12 +36,12 @@ async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
}
await interaction.editReply(msg_downloading(url));
requestSong(url, { user: interaction.user.username }).then(() => {
interaction.editReply(msg_play());
})
await requestSong(url, { user: interaction.user.username })
await interaction.editReply(msg_play());
} catch (error) {
console.error(error);
await interaction.editReply('Coś poszło nie tak :/');
const message = error instanceof Error ? error.message : 'Coś poszło nie tak :/'
await interaction.editReply(message);
}
}