dodano obsłuugę linków ze spotify oraz soundcloud
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user