Updated music system with new extractor and small tweaks

This commit is contained in:
2024-08-23 20:21:46 +02:00
parent d350552d25
commit 3c8848f615
6 changed files with 83 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ import env from "utils/Env.js"
import loadAllEvents from "./Events/loadevents.js"
import { Player } from "discord-player"
import { Sequelize } from "sequelize"
import { YoutubeiExtractor } from "discord-player-youtubei"
const client = new Client()
const redis = new Redis(env.prod.redisURI!)
@@ -32,7 +33,9 @@ class Illegitimate {
async start() {
await this.init()
await loadAllEvents(client, ft)
await player.extractors.loadDefault()
// await player.extractors.loadDefault()
await player.extractors.loadDefault(ext => ext != "YouTubeExtractor")
await player.extractors.register(YoutubeiExtractor, {})
await client.start()
await this.databases()
}
@@ -41,12 +44,14 @@ class Illegitimate {
redis.on("ready", () => {
console.log(color("Connected to Redis", "green"))
})
// if (process.env.NODE_ENV === "dev") {
// sequelize.sync().then(() => {
// console.log(color("Synced the db [dev]", "green"))
// })
// }
// connect(env.prod.mongoURI!, {}).then(() => {
// console.log(color("Connected to MongoDB", "green"))
// })
sequelize.sync().then(() => {
console.log(color("Connected to Postgres", "green"))
})
}
private async init() {