format wiadomości

This commit is contained in:
Patryk Koreń
2026-01-03 20:58:23 +01:00
parent 765157f754
commit 28b6546c25
10 changed files with 118 additions and 34 deletions

View File

@@ -1,7 +1,7 @@
import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
import { connectToChannelByInteraction } from '../util/helpers';
import { forceRequestSong } from '../playback';
import { getPlayMsg } from '../messages';
import { getPlayMsg, msg_downloading, msg_play, msg_searching } from '../messages';
import { search } from '../util/downloader';
const name = "forceplay"
@@ -26,16 +26,16 @@ async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
if (input.startsWith("http")) {
url = input
} else {
await interaction.editReply(`searching for: ${input}`);
await interaction.editReply(msg_searching(input));
url = await search(input)
console.log(input, url)
}
await interaction.editReply(`downloading: ${url}`);
await interaction.editReply(msg_downloading(url));
await forceRequestSong(interaction, url)
const msg = getPlayMsg(url)
await interaction.editReply(msg);
await interaction.editReply(msg_play());
} catch (error) {
console.error(error);
await interaction.editReply('Coś poszło nie tak :/');