From 39f503a7e4af91d6b6a4e6da5fd816072b4fb94b Mon Sep 17 00:00:00 2001 From: Snowflake107 <46562212+Snowflake107@users.noreply.github.com> Date: Mon, 5 Jul 2021 13:11:06 +0545 Subject: [PATCH] refactor(example): xID to xId --- example/music-bot/index.js | 24 ++++++++++++------------ example/music-bot/package.json | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/example/music-bot/index.js b/example/music-bot/index.js index a6c34df..c423924 100644 --- a/example/music-bot/index.js +++ b/example/music-bot/index.js @@ -153,13 +153,13 @@ client.on("messageCreate", async (message) => { }); client.on("interaction", async (interaction) => { - if (!interaction.isCommand() || !interaction.guildID) return; + if (!interaction.isCommand() || !interaction.guildId) return; if (!(interaction.member instanceof GuildMember) || !interaction.member.voice.channel) { return void interaction.reply({ content: "You are not in a voice channel!", ephemeral: true }); } - if (interaction.guild.me.voice.channelID && interaction.member.voice.channelID !== interaction.guild.me.voice.channelID) { + if (interaction.guild.me.voice.channelId && interaction.member.voice.channelId !== interaction.guild.me.voice.channelId) { return void interaction.reply({ content: "You are not in my voice channel!", ephemeral: true }); } @@ -182,7 +182,7 @@ client.on("interaction", async (interaction) => { try { if (!queue.connection) await queue.connect(interaction.member.voice.channel); } catch { - void player.deleteQueue(interaction.guildID); + void player.deleteQueue(interaction.guildId); return void interaction.followUp({ content: "Could not join your voice channel!" }); } @@ -191,7 +191,7 @@ client.on("interaction", async (interaction) => { if (!queue.playing) await queue.play(); } else if (interaction.commandName === "volume") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const vol = interaction.options.get("amount"); if (!vol) return void interaction.followUp({ content: `🎧 | Current volume is **${queue.volume}**%!` }); @@ -202,7 +202,7 @@ client.on("interaction", async (interaction) => { }); } else if (interaction.commandName === "skip") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const currentTrack = queue.current; const success = queue.skip(); @@ -211,7 +211,7 @@ client.on("interaction", async (interaction) => { }); } else if (interaction.commandName === "queue") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const currentTrack = queue.current; const tracks = queue.tracks.slice(0, 10).map((m, i) => { @@ -234,25 +234,25 @@ client.on("interaction", async (interaction) => { }); } else if (interaction.commandName === "pause") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const success = queue.setPaused(true); return void interaction.followUp({ content: success ? "⏸ | Paused!" : "❌ | Something went wrong!" }); } else if (interaction.commandName === "resume") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const success = queue.setPaused(false); return void interaction.followUp({ content: success ? "▶ | Resumed!" : "❌ | Something went wrong!" }); } else if (interaction.commandName === "stop") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); queue.destroy(); return void interaction.followUp({ content: "🛑 | Stopped the player!" }); } else if (interaction.commandName === "np") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const progress = queue.createProgressBar(); const perc = queue.getPlayerTimestamp(); @@ -274,7 +274,7 @@ client.on("interaction", async (interaction) => { }); } else if (interaction.commandName === "loop") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); const loopMode = interaction.options.get("mode").value; const success = queue.setRepeatMode(loopMode); @@ -282,7 +282,7 @@ client.on("interaction", async (interaction) => { return void interaction.followUp({ content: success ? `${mode} | Updated loop mode!` : "❌ | Could not update loop mode!" }); } else if (interaction.commandName === "bassboost") { await interaction.defer(); - const queue = player.getQueue(interaction.guildID); + const queue = player.getQueue(interaction.guildId); if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" }); await queue.setFilters({ bassboost: !queue.getFiltersEnabled().includes("bassboost"), diff --git a/example/music-bot/package.json b/example/music-bot/package.json index b45b2a4..48fc9a7 100644 --- a/example/music-bot/package.json +++ b/example/music-bot/package.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@discordjs/opus": "^0.5.3", - "discord-player": "^5.0.0-dev.b0fa95473878f59791f5ac373b747d9cf0592f08", - "discord.js": "^13.0.0-dev.6d3d00b44577a70e840f0187d6894043677c5329" + "discord-player": "^5.0.0-dev.5bad0fc.1625467720", + "discord.js": "^13.0.0-dev.fe5d56c.1625443439" } }