added rzeczy

This commit is contained in:
Patryk Koreń
2025-12-26 20:45:38 +01:00
parent 375779de9c
commit b551cce62a
14 changed files with 326 additions and 91 deletions

36
src/commands/forceplay.ts Normal file
View File

@@ -0,0 +1,36 @@
import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
import { connectToChannelByInteraction } from '../util/helpers';
import { forceRequestSong } from '../playback';
import { getPlayMsg } from '../messages';
const name = "forceplay"
function register() {
return new SlashCommandBuilder()
.setName(name)
.setDescription('YT')
.addStringOption((option) => option.setName("url")
.setDescription("YT url")
.setRequired(true))
}
async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
try {
connectToChannelByInteraction(interaction)
const url = interaction.options.getString("url")!;
await forceRequestSong(interaction, url)
const msg = getPlayMsg(url)
await interaction.reply(msg);
} catch (error) {
console.error(error);
await interaction.reply('Coś poszło nie tak :/');
}
}
export default {
name,
register,
execute
}