refactor(example): xID to xId

This commit is contained in:
Snowflake107 2021-07-05 13:11:06 +05:45
parent 245745b22c
commit 39f503a7e4
No known key found for this signature in database
GPG key ID: FA40E3EC5CB6DCD6
2 changed files with 14 additions and 14 deletions

View file

@ -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"),

View file

@ -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"
}
}