diff --git a/commands/general/avatar.js b/commands/general/avatar.js index 0985460..8e7ea42 100644 --- a/commands/general/avatar.js +++ b/commands/general/avatar.js @@ -4,7 +4,7 @@ const mentionRegex = /^?$/; class AvatarCommand extends Command { async run() { const member = this.options.member ?? this.args[0]; - const self = this.client.users.get(this.author.id) ?? await this.client.rest.users.get(this.author.id); + const self = this.client.users.get(this.author) ?? await this.client.rest.users.get(this.author); if (this.type === "classic" && this.message.mentions.users[0]) { return this.message.mentions.users[0].avatarURL(null, 512); } else if (member && member > 21154535154122752n) { diff --git a/commands/general/banner.js b/commands/general/banner.js index 83d71f1..b2a8727 100644 --- a/commands/general/banner.js +++ b/commands/general/banner.js @@ -6,7 +6,7 @@ class BannerCommand extends Command { // this command sucks async run() { const member = this.options.member ?? this.args[0]; - const self = await this.client.rest.users.get(this.author.id); // banners are only available over REST + const self = await this.client.rest.users.get(this.author); // banners are only available over REST if (this.type === "classic" && this.message.mentions.users[0] && this.message.mentions.users[0].banner) { return this.client.util.formatImage(Routes.BANNER(this.message.mentions.users[0].id, this.message.mentions.users[0].banner), null, 512); } else if (member && member > 21154535154122752n) { diff --git a/commands/general/broadcast.js b/commands/general/broadcast.js index fdf2d2b..9e65fb9 100644 --- a/commands/general/broadcast.js +++ b/commands/general/broadcast.js @@ -5,7 +5,7 @@ import { endBroadcast, startBroadcast } from "../../utils/misc.js"; class BroadcastCommand extends Command { async run() { const owners = process.env.OWNER.split(","); - if (!owners.includes(this.author.id)) { + if (!owners.includes(this.author)) { this.success = false; return "Only the bot owner can broadcast messages!"; } diff --git a/commands/general/eval.js b/commands/general/eval.js index 4ca045d..083e02c 100644 --- a/commands/general/eval.js +++ b/commands/general/eval.js @@ -4,7 +4,7 @@ import Command from "../../classes/command.js"; class EvalCommand extends Command { async run() { const owners = process.env.OWNER.split(","); - if (!owners.includes(this.author.id)) { + if (!owners.includes(this.author)) { this.success = false; return "Only the bot owner can use eval!"; } diff --git a/commands/general/exec.js b/commands/general/exec.js index 3d4a036..c5bef54 100644 --- a/commands/general/exec.js +++ b/commands/general/exec.js @@ -7,7 +7,7 @@ import Command from "../../classes/command.js"; class ExecCommand extends Command { async run() { const owners = process.env.OWNER.split(","); - if (!owners.includes(this.author.id)) { + if (!owners.includes(this.author)) { this.success = false; return "Only the bot owner can use exec!"; } @@ -15,7 +15,7 @@ class ExecCommand extends Command { const code = this.options.cmd ?? this.args.join(" "); try { const execed = await exec(code); - if (execed.stderr) return `\`ERROR\` \`\`\`xl\n${await clean(execed.stderr)}\n\`\`\``; + if (execed.stderr) return `\`\`\`xl\n${await clean(execed.stderr)}\n\`\`\``; const cleaned = await clean(execed.stdout); const sendString = `\`\`\`bash\n${cleaned}\n\`\`\``; if (sendString.length >= 2000) { diff --git a/commands/general/imagereload.js b/commands/general/imagereload.js index 6e612a3..c37f7d2 100644 --- a/commands/general/imagereload.js +++ b/commands/general/imagereload.js @@ -4,7 +4,7 @@ import { reloadImageConnections } from "../../utils/image.js"; class ImageReloadCommand extends Command { async run() { const owners = process.env.OWNER.split(","); - if (!owners.includes(this.author.id)) { + if (!owners.includes(this.author)) { this.success = false; return "Only the bot owner can reload the image servers!"; } diff --git a/commands/general/restart.js b/commands/general/restart.js index e4bbfc3..087dea8 100644 --- a/commands/general/restart.js +++ b/commands/general/restart.js @@ -3,12 +3,12 @@ import Command from "../../classes/command.js"; class RestartCommand extends Command { async run() { const owners = process.env.OWNER.split(","); - if (!owners.includes(this.author.id)) { + if (!owners.includes(this.author)) { this.success = false; return "Only the bot owner can restart me!"; } await this.channel.createMessage(Object.assign({ - content: "esmBot is restarting." + content: "mrmBot is restarting." }, this.reference)); process.exit(1); } diff --git a/commands/general/soundreload.js b/commands/general/soundreload.js index d030c11..a405a29 100644 --- a/commands/general/soundreload.js +++ b/commands/general/soundreload.js @@ -4,7 +4,7 @@ import { reload } from "../../utils/soundplayer.js"; class SoundReloadCommand extends Command { async run() { const owners = process.env.OWNER.split(","); - if (!owners.includes(this.author.id)) { + if (!owners.includes(this.author)) { this.success = false; return "Only the bot owner can reload Lavalink!"; } diff --git a/commands/message/select-image.js b/commands/message/select-image.js index 54400ed..22f5b68 100644 --- a/commands/message/select-image.js +++ b/commands/message/select-image.js @@ -15,7 +15,7 @@ class SelectImageCommand extends Command { } else if (image.type === "tenorlimit") { return "I've been rate-limited by Tenor. Please try uploading your GIF elsewhere."; } - selectedImages.set(this.author.id, image); + selectedImages.set(this.author, image); return "The image has been selected for your next command."; } } diff --git a/commands/music/host.js b/commands/music/host.js index 20c89de..008d52b 100644 --- a/commands/music/host.js +++ b/commands/music/host.js @@ -8,7 +8,7 @@ class HostCommand extends MusicCommand { if (!this.member.voiceState) return "You need to be in a voice channel first!"; if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; if (!this.connection) return "I haven't completely connected yet!"; - if (this.connection.host !== this.author.id && !process.env.OWNER.split(",").includes(this.connection.host)) return "Only the current voice session host can choose another host!"; + if (this.connection.host !== this.author && !process.env.OWNER.split(",").includes(this.connection.host)) return "Only the current voice session host can choose another host!"; const input = this.options.user ?? this.args.join(" "); if (input?.trim()) { let user; diff --git a/commands/music/loop.js b/commands/music/loop.js index b37f494..951d278 100644 --- a/commands/music/loop.js +++ b/commands/music/loop.js @@ -8,7 +8,7 @@ class LoopCommand extends MusicCommand { if (!this.member.voiceState) return "You need to be in a voice channel first!"; if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; if (!this.connection) return "I haven't completely connected yet!"; - if (this.connection.host !== this.author.id && !this.member.permissions.has("MANAGE_CHANNELS")) return "Only the current voice session host can loop the music!"; + if (this.connection.host !== this.author && !this.member.permissions.has("MANAGE_CHANNELS")) return "Only the current voice session host can loop the music!"; const object = this.connection; object.loop = !object.loop; players.set(this.guild.id, object); diff --git a/commands/music/remove.js b/commands/music/remove.js index c381b21..48a0840 100644 --- a/commands/music/remove.js +++ b/commands/music/remove.js @@ -8,7 +8,7 @@ class RemoveCommand extends MusicCommand { if (!this.member.voiceState) return "You need to be in a voice channel first!"; if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; if (!this.connection) return "I haven't completely connected yet!"; - if (this.connection.host !== this.author.id && !process.env.OWNER.split(",").includes(this.connection.host)) return "Only the current voice session host can remove songs from the queue!"; + if (this.connection.host !== this.author && !process.env.OWNER.split(",").includes(this.connection.host)) return "Only the current voice session host can remove songs from the queue!"; const pos = parseInt(this.options.position ?? this.args[0]); if (isNaN(pos) || pos > this.queue.length || pos < 1) return "That's not a valid position!"; const removed = this.queue.splice(pos, 1); diff --git a/commands/music/seek.js b/commands/music/seek.js index 6972e98..dc789f0 100644 --- a/commands/music/seek.js +++ b/commands/music/seek.js @@ -7,7 +7,7 @@ class SeekCommand extends MusicCommand { if (!this.member.voiceState) return "You need to be in a voice channel first!"; if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; if (!this.connection) return "I haven't completely connected yet!"; - if (this.connection.host !== this.author.id) return "Only the current voice session host can seek the music!"; + if (this.connection.host !== this.author) return "Only the current voice session host can seek the music!"; const player = this.connection.player; const track = await player.node.rest.decode(player.track); if (!track.isSeekable) return "This track isn't seekable!"; diff --git a/commands/music/shuffle.js b/commands/music/shuffle.js index bc02a0a..022d4d2 100644 --- a/commands/music/shuffle.js +++ b/commands/music/shuffle.js @@ -8,7 +8,7 @@ class ShuffleCommand extends MusicCommand { if (!this.member.voiceState) return "You need to be in a voice channel first!"; if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; if (!this.connection) return "I haven't completely connected yet!"; - if (this.connection.host !== this.author.id) return "Only the current voice session host can shuffle the music!"; + if (this.connection.host !== this.author) return "Only the current voice session host can shuffle the music!"; const object = this.connection; object.shuffle = !object.shuffle; players.set(this.guildID, object); diff --git a/commands/music/skip.js b/commands/music/skip.js index 00ee076..4c68d68 100644 --- a/commands/music/skip.js +++ b/commands/music/skip.js @@ -9,12 +9,12 @@ class SkipCommand extends MusicCommand { if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; const player = this.connection; if (!player) return "I haven't completely connected yet!"; - if (player.host !== this.author.id && !this.member.permissions.has("MANAGE_CHANNELS")) { + if (player.host !== this.author && !this.member.permissions.has("MANAGE_CHANNELS")) { const votes = skipVotes.get(this.guild.id) ?? { count: 0, ids: [], max: Math.min(3, player.voiceChannel.voiceMembers.filter((i) => i.id !== this.client.user.id && !i.bot).length) }; - if (votes.ids.includes(this.author.id)) return "You've already voted to skip!"; + if (votes.ids.includes(this.author)) return "You've already voted to skip!"; const newObject = { count: votes.count + 1, - ids: [...votes.ids, this.author.id].filter(item => !!item), + ids: [...votes.ids, this.author].filter(item => !!item), max: votes.max }; if (votes.count + 1 === votes.max) { diff --git a/commands/music/stop.js b/commands/music/stop.js index 125dcd4..712534f 100644 --- a/commands/music/stop.js +++ b/commands/music/stop.js @@ -12,7 +12,7 @@ class StopCommand extends MusicCommand { this.success = true; return "🔊 The current voice channel session has ended."; } - if (this.connection.host !== this.author.id && !this.member.permissions.has("MANAGE_CHANNELS")) return "Only the current voice session host can stop the music!"; + if (this.connection.host !== this.author && !this.member.permissions.has("MANAGE_CHANNELS")) return "Only the current voice session host can stop the music!"; const connection = this.connection.player; connection.node.leaveChannel(this.guild.id); players.delete(this.guild.id); diff --git a/commands/music/toggle.js b/commands/music/toggle.js index fd633f3..e642547 100644 --- a/commands/music/toggle.js +++ b/commands/music/toggle.js @@ -7,7 +7,7 @@ class ToggleCommand extends MusicCommand { if (!this.member.voiceState) return "You need to be in a voice channel first!"; if (!this.guild.voiceStates.has(this.client.user.id)) return "I'm not in a voice channel!"; if (!this.connection) return "I haven't completely connected yet!"; - if (this.connection.host !== this.author.id && !this.member.permissions.has("MANAGE_CHANNELS")) return "Only the current voice session host can pause/resume the music!"; + if (this.connection.host !== this.author && !this.member.permissions.has("MANAGE_CHANNELS")) return "Only the current voice session host can pause/resume the music!"; const player = this.connection.player; player.setPaused(!player.paused ? true : false); this.success = true; diff --git a/commands/tags/tags.js b/commands/tags/tags.js index 3d3f87e..aaae49a 100644 --- a/commands/tags/tags.js +++ b/commands/tags/tags.js @@ -27,7 +27,7 @@ class TagsCommand extends Command { const getResult = await database.getTag(this.guild.id, tagName); if (!getResult) return "This tag doesn't exist!"; const owners = process.env.OWNER.split(","); - if (getResult.author !== this.author.id && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author.id)) return "You don't own this tag!"; + if (getResult.author !== this.author && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author)) return "You don't own this tag!"; await database.removeTag(tagName, this.guild); this.success = true; return `The tag \`${tagName}\` has been deleted!`; @@ -36,7 +36,7 @@ class TagsCommand extends Command { const getResult = await database.getTag(this.guild.id, tagName); if (!getResult) return "This tag doesn't exist!"; const owners = process.env.OWNER.split(","); - if (getResult.author !== this.author.id && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author.id)) return "You don't own this tag!"; + if (getResult.author !== this.author && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author)) return "You don't own this tag!"; await database.editTag(tagName, { content: this.type === "classic" ? this.args.slice(2).join(" ") : this.optionsArray[0].options[1].value, author: this.member.id }, this.guild); this.success = true; return `The tag \`${tagName}\` has been edited!`;