From 46a8be1ff2d5a17f0a0dffd5de1dd263aa29c7a3 Mon Sep 17 00:00:00 2001 From: ComicallyBad Date: Fri, 6 Dec 2024 15:28:11 -0500 Subject: [PATCH 1/3] fix: Cannot read properties of undefined (reading 'rest') --- dist/src/entities/Player.js | 2 +- dist/src/entities/Player.js.map | 2 +- src/entities/Player.ts | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dist/src/entities/Player.js b/dist/src/entities/Player.js index 3ed0751..92743d8 100644 --- a/dist/src/entities/Player.js +++ b/dist/src/entities/Player.js @@ -38,8 +38,8 @@ class Player { this.autoPlay = config.autoPlay || false; this.autoLeave = config.autoLeave || false; this.queue = new (index_1.Structure.get("Queue"))(); - this.filters = new (index_1.Structure.get("Filters"))(this); this.node = this.manager.nodes.get(config.node); + this.filters = new (index_1.Structure.get("Filters"))(this); if (manager.options.NodeLinkFeatures || this.node.info.isNodeLink) { this.listen = new (index_1.Structure.get("Listen"))(this); this.lyrics = new (index_1.Structure.get("Lyrics"))(this); diff --git a/dist/src/entities/Player.js.map b/dist/src/entities/Player.js.map index 328f468..3e6d892 100644 --- a/dist/src/entities/Player.js.map +++ b/dist/src/entities/Player.js.map @@ -1 +1 @@ -{"version":3,"file":"Player.js","sourceRoot":"","sources":["../../../src/entities/Player.ts"],"names":[],"mappings":";;;AAEA,uCAAqI;AAErI,MAAa,MAAM;IACR,OAAO,CAAU;IACnB,OAAO,CAAS;IAChB,cAAc,CAAS;IACvB,aAAa,CAAS;IACtB,UAAU,GAAgB,EAAE,CAAC;IAC7B,QAAQ,CAAU;IAClB,SAAS,CAAU;IACnB,SAAS,CAAU;IACnB,OAAO,CAAU;IACjB,MAAM,CAAU;IAChB,MAAM,GAAW,EAAE,CAAC;IACpB,IAAI,GAAgB,KAAK,CAAC;IAC1B,OAAO,CAAQ;IACf,QAAQ,CAAkB;IAC1B,IAAI,GAAW,CAAC,CAAC;IACjB,KAAK,CAAQ;IACb,IAAI,CAAO;IACX,IAAI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C,IAAI,CAAC,MAAM,CAAC;YACpB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,OAAO,CAAC,IAAiB;QAC9B,IAAA,wBAAgB,EACd,IAAI,EACJ,CAAC,KAAU,EAAE,EAAE,CACb,KAAK,KAAK,SAAS;YACnB,KAAK,KAAK,KAAK;YACf,KAAK,KAAK,OAAO;YACjB,KAAK,KAAK,OAAO,EACnB,uDAAuD,CACxD,CAAC;QACF,IAAI,OAAO,GAAgB,IAAI,CAAC,IAAI,CAAC;QAErC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,OAAO;QACZ,IAAI,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,UAAU,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1UD,wBA0UC"} \ No newline at end of file +{"version":3,"file":"Player.js","sourceRoot":"","sources":["../../../src/entities/Player.ts"],"names":[],"mappings":";;;AAEA,uCAAqI;AAErI,MAAa,MAAM;IACR,OAAO,CAAU;IACnB,OAAO,CAAS;IAChB,cAAc,CAAS;IACvB,aAAa,CAA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AAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1UD,wBA0UC"} \ No newline at end of file diff --git a/src/entities/Player.ts b/src/entities/Player.ts index 91ef359..66227e9 100644 --- a/src/entities/Player.ts +++ b/src/entities/Player.ts @@ -39,8 +39,8 @@ export class Player { this.autoPlay = config.autoPlay || false; this.autoLeave = config.autoLeave || false; this.queue = new (Structure.get("Queue"))(); - this.filters = new (Structure.get("Filters"))(this); this.node = this.manager.nodes.get(config.node); + this.filters = new (Structure.get("Filters"))(this); if (manager.options.NodeLinkFeatures || this.node.info.isNodeLink) { this.listen = new (Structure.get("Listen"))(this); this.lyrics = new (Structure.get("Lyrics"))(this); @@ -104,7 +104,7 @@ export class Player { return true; } - public connect(options: { setMute?: boolean; setDeaf?: boolean }): boolean { + public connect(options: { setMute?: boolean; setDeaf?: boolean }): boolean { this.manager.sendPayload( this.guildId, JSON.stringify({ @@ -117,7 +117,7 @@ export class Player { }, }) ); - + this.connected = true; this.manager.emit("playerConnected", this); return true; @@ -206,9 +206,9 @@ export class Player { }, }, }); - + options?.destroy ? this.destroy() - : this.queue.clear(); + : this.queue.clear(); this.playing = false; this.manager.emit("playerTriggeredStop", this); @@ -216,7 +216,7 @@ export class Player { } public async skip(position?: number): Promise { - if(!this.queue.size && this.autoPlay) { + if (!this.queue.size && this.autoPlay) { await this.node.rest.update({ guildId: this.guildId, data: { @@ -226,7 +226,7 @@ export class Player { }, }); } else if (!this.queue.size) return false; - + validateProperty( position, (value) => @@ -302,7 +302,7 @@ export class Player { volume: this.volume, }, }); - + this.manager.emit("playerChangedVolume", this, oldVolume, volume); return true; } From 36820fc79aa215d9f9112a4d88b4298f491862c9 Mon Sep 17 00:00:00 2001 From: ComicallyBad Date: Fri, 6 Dec 2024 15:30:56 -0500 Subject: [PATCH 2/3] feat: refactor command handling --- testBot/bot.js | 62 +++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/testBot/bot.js b/testBot/bot.js index e98830b..6ec577e 100644 --- a/testBot/bot.js +++ b/testBot/bot.js @@ -83,40 +83,41 @@ function createPlayerButtons() { client.on("messageCreate", async (message) => { if (message.author.bot) return; - const player = client.manager.players.get(message.guild.id); - - if (message.content.toLowerCase() === "?c") { + if (message.content.startsWith("?")) { + let player = client.manager.players.get(message.guild.id); const channel = message.member.voice.channel; - if (!channel) return message.reply("You need to join a voice channel first!"); + const [command, ...args] = message.content.slice(1).trim().split(/ +/); + switch (command) { + case 'c': + if (!channel) return message.reply("You need to join a voice channel first!"); - const player = client.manager.createPlayer({ - guildId: message.guild.id, - voiceChannelId: channel.id, - textChannelId: message.channel.id, - }); + player = client.manager.createPlayer({ + guildId: message.guild.id, + voiceChannelId: channel.id, + textChannelId: message.channel.id, + }); - if (!player.connected) { - player.connect({ setDeaf: true }); - } + if (!player.connected) { + player.connect({ setDeaf: true }); + } - await message.channel.send({ - content: "🎡 **Music Player Controls** 🎡", - components: createPlayerButtons(), - }); - } + await message.channel.send({ + content: "🎡 **Music Player Controls** 🎡", + components: createPlayerButtons(), + }); + break; - if (message.content.startsWith("?")) { - const [command, ...args] = message.content.slice(1).trim().split(/ +/); - switch (command) { case 'play': + if (!channel) return message.reply("You need to join a voice channel first!"); if (!args[0]) return message.reply("You need to provide a song or URL!"); - const player = client.manager.createPlayer({ + + player = client.manager.createPlayer({ guildId: message.guild.id, voiceChannelId: message.member.voice.channelId, textChannelId: message.channel.id, autoPlay: true, }); - + if (!player.connected) { player.connect({ setDeaf: true }); } @@ -124,9 +125,9 @@ client.on("messageCreate", async (message) => { const searchResult = await client.manager.search({ query: args.join(" ") }) - + if (!searchResult.tracks.length) return message.reply("No results found."); - + player.queue.add(searchResult.tracks[0]); if (!player.playing) player.play(); await message.reply(`Playing track: ${searchResult.tracks[0].title}`); @@ -174,12 +175,14 @@ client.on("messageCreate", async (message) => { player.setLoop(nextLoop); await message.reply(`Loop mode set to ${nextLoop}`); break; + case 'queue': const queue = player.queue.map((track, index) => `${index + 1}. ${track.title}`).join("\n"); await message.reply(`**Queue**\n${queue}`); break; + case 'eval': - if (message.author.id !== '978981769661513758') return; + if (message.author.id !== process.env.USERID) return; try { const result = eval(args.join(" ")); await message.reply(`\`\`\`js\n${result}\`\`\``); @@ -201,29 +204,35 @@ client.on("interactionCreate", async (interaction) => { switch (interaction.customId) { case 'play': - if (!player.playing) player.play(); + player.resume(); await interaction.reply("▢️ Music resumed!"); break; + case 'pause': player.pause(); await interaction.reply("⏸️ Music paused!"); break; + case 'stop': player.stop(); await interaction.reply("⏹️ Music stopped!"); break; + case 'volume_up': player.setVolume(player.volume + 10); await interaction.reply(`πŸ”Š Volume increased to ${player.volume}`); break; + case 'volume_down': player.setVolume(player.volume - 10); await interaction.reply(`πŸ”‰ Volume decreased to ${player.volume}`); break; + case 'shuffle': player.shuffle(); await interaction.reply("πŸ”€ Queue shuffled!"); break; + case 'loop': const loopModes = ["off", "track", "queue"]; const currentLoop = player.loop; @@ -231,6 +240,7 @@ client.on("interactionCreate", async (interaction) => { player.setLoop(nextLoop); await interaction.reply(`πŸ” Loop mode set to ${nextLoop}`); break; + case 'skip': if (!player.queue.size) return interaction.reply("No more songs in the queue to skip."); await player.skip(); From 617e506284a485fde04a85b2e75e7d8a9dc24f10 Mon Sep 17 00:00:00 2001 From: ComicallyBad Date: Fri, 6 Dec 2024 15:52:01 -0500 Subject: [PATCH 3/3] fix: update eval command to allow `process.env.DISCORD_ID` --- testBot/bot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testBot/bot.js b/testBot/bot.js index 6ec577e..3f6acee 100644 --- a/testBot/bot.js +++ b/testBot/bot.js @@ -182,7 +182,7 @@ client.on("messageCreate", async (message) => { break; case 'eval': - if (message.author.id !== process.env.USERID) return; + if (message.author.id !== "978981769661513758" && message.author.id !== process.env.DISCORD_ID) return; try { const result = eval(args.join(" ")); await message.reply(`\`\`\`js\n${result}\`\`\``);