Updated music system

This commit is contained in:
2025-03-01 21:40:35 +01:00
parent dae76df165
commit 2d21b0874f
5 changed files with 868 additions and 177 deletions

View File

@@ -20,9 +20,10 @@ const cmd: SubCommand = async (interaction) => {
}
if (amount > queue.size) {
queue.delete()
await interaction.editReply({
embeds: [{
description: `There are only ${queue.size} song${queue.size === 1 ? "" : "s"} in the queue`,
description: "Skipped all songs in the queue",
color: embedColor
}]
})

View File

@@ -19,9 +19,11 @@ export default {
const player = useMainPlayer()
const { tracks } = await player.search(focusedOption.value, {
searchEngine: QueryType.YOUTUBE_SEARCH
searchEngine: QueryType.SPOTIFY_SEARCH
})
console.log(tracks)
const results = tracks.map(track => ({
name: `${track.title.slice(0, 20)} [${track.author}]`,
value: track.url

View File

@@ -1,5 +1,5 @@
import { DefaultExtractors } from "@discord-player/extractor"
import { Player } from "discord-player"
import { YoutubeiExtractor } from "discord-player-youtubei"
import { Redis } from "ioredis"
import { ExtendedClient as Client } from "~/utils/Client.js"
import env from "~/utils/Env.js"
@@ -20,9 +20,7 @@ if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT === "true") {
class Illegitimate {
async start() {
await loadAllEvents(client, ft)
// await player.extractors.loadDefault()
await player.extractors.loadDefault(ext => ext != "YouTubeExtractor")
await player.extractors.register(YoutubeiExtractor, {})
await player.extractors.loadMulti(DefaultExtractors)
await client.start()
await this.databases()
this.loadMethods()