dodano obsłuugę linków ze spotify oraz soundcloud

This commit is contained in:
Patryk Koreń
2026-01-03 22:48:46 +01:00
parent 28b6546c25
commit 6ad7e01957
7 changed files with 1299 additions and 23 deletions

View File

@@ -2,7 +2,7 @@ import { CacheType, ChatInputCommandInteraction, SlashCommandBuilder } from 'dis
import { connectToChannelByInteraction } from '../util/helpers';
import { requestSong } from '../playback';
import { getPlayMsg, msg_downloading, msg_play, msg_searching } from '../messages';
import { search } from '../util/downloader';
import { search, spotifyToYouTube } from '../util/downloader';
const name = "play"
@@ -23,7 +23,11 @@ async function execute(interaction: ChatInputCommandInteraction<CacheType>) {
const input = interaction.options.getString("url")!;
let url: string;
if (input.startsWith("http")) {
if (input.startsWith("https://open.spotify.com/")) {
await interaction.editReply(msg_searching(input));
url = await spotifyToYouTube(input)
}
else if (input.startsWith("http")) {
url = input
} else {
await interaction.editReply(msg_searching(input));