diff --git a/commands/edit-text/mocking.js b/commands/edit-text/mocking.js index ac78d5dd..893ff680 100644 --- a/commands/edit-text/mocking.js +++ b/commands/edit-text/mocking.js @@ -1,4 +1,5 @@ const Command = require('../../framework/Command'); +const { PermissionFlagsBits } = require('discord.js'); const { MOCKING_EMOJI_ID, MOCKING_EMOJI_NAME } = process.env; module.exports = class MockingCommand extends Command { diff --git a/commands/events/apod.js b/commands/events/apod.js index a32ecf5c..47d51258 100644 --- a/commands/events/apod.js +++ b/commands/events/apod.js @@ -1,6 +1,6 @@ const Command = require('../../framework/Command'); const request = require('node-superfetch'); -const { EmbedBuilder } = require('discord.js'); +const { EmbedBuilder, PermissionFlagsBits } = require('discord.js'); const { shorten } = require('../../util/Util'); const logos = require('../../assets/json/logos'); const { GOV_KEY } = process.env; diff --git a/commands/games-sp/20-questions.js b/commands/games-sp/20-questions.js index f7e70a5d..4b0b4348 100644 --- a/commands/games-sp/20-questions.js +++ b/commands/games-sp/20-questions.js @@ -66,7 +66,11 @@ module.exports = class TwentyQuestionsCommand extends Command { const row = rows[Math.floor(i / 5)]; const components = answers.slice(i, i + 5); for (const component of components) { - row.addComponents(new ButtonBuilder().setCustomId(component).setStyle(ButtonStyle.Primary).setLabel(component)); + const button = new ButtonBuilder() + .setCustomId(component) + .setStyle(ButtonStyle.Primary) + .setLabel(component); + row.addComponents(button); } } const sRow = new ActionRowBuilder(); diff --git a/commands/games-sp/anime-score.js b/commands/games-sp/anime-score.js index 01617a95..fc003a17 100644 --- a/commands/games-sp/anime-score.js +++ b/commands/games-sp/anime-score.js @@ -1,5 +1,5 @@ const Command = require('../../framework/Command'); -const { EmbedBuilder } = require('discord.js'); +const { EmbedBuilder, PermissionFlagsBits } = require('discord.js'); const request = require('node-superfetch'); const { stripIndents } = require('common-tags'); const logos = require('../../assets/json/logos'); diff --git a/commands/info/avatar.js b/commands/info/avatar.js index d0450d4c..c7c52a32 100644 --- a/commands/info/avatar.js +++ b/commands/info/avatar.js @@ -34,7 +34,10 @@ module.exports = class AvatarCommand extends Command { const embed = new EmbedBuilder() .setTitle(user.tag) .setDescription( - formats.map(fmt => embedURL(displayFmts[fmt], user.displayAvatarURL({ extension: fmt, size: 2048 }))).join(' | ') + formats.map(fmt => { + const avatar = user.displayAvatarURL({ extension: fmt, size: 2048 }); + return embedURL(displayFmts[fmt], avatar); + }).join(' | ') ) .setImage(user.displayAvatarURL({ format, size: 2048 })) .setColor(0x00AE86); diff --git a/commands/util-voice/join.js b/commands/util-voice/join.js index e32eef36..5b448f06 100644 --- a/commands/util-voice/join.js +++ b/commands/util-voice/join.js @@ -2,6 +2,7 @@ const Command = require('../../framework/Command'); const { PermissionFlagsBits } = require('discord.js'); const { joinVoiceChannel } = require('@discordjs/voice'); const Dispatcher = require('../../structures/Dispatcher'); +const perms = [PermissionFlagsBits.Connect, PermissionFlagsBits.Speak, PermissionFlagsBits.ViewChannel]; module.exports = class JoinCommand extends Command { constructor(client) { @@ -20,7 +21,7 @@ module.exports = class JoinCommand extends Command { run(msg) { const voiceChannel = msg.member.voice.channel; if (!voiceChannel) return msg.reply('Please enter a voice channel first.'); - if (!voiceChannel.permissionsFor(this.client.user).has([PermissionFlagsBits.Connect, PermissionFlagsBits.Speak, 'VIEW_CHANNEL'])) { + if (!voiceChannel.permissionsFor(this.client.user).has(perms)) { return msg.reply('I\'m missing the "Connect", "Speak", or "View Channel" permission for this channel.'); } if (!voiceChannel.joinable) return msg.reply('Your voice channel is not joinable.'); diff --git a/structures/activity.js b/structures/activity.js index 2556cd03..001acf2f 100644 --- a/structures/activity.js +++ b/structures/activity.js @@ -59,15 +59,11 @@ module.exports = [ type: ActivityType.Playing }, { - text: (client) => `${formatNumber(client.guilds.cache.size)} servers`, + text: client => `${formatNumber(client.guilds.cache.size)} servers`, type: ActivityType.Watching }, { - text: (client) => `with ${formatNumber(client.registry.commands.size)} commands`, + text: client => `with ${formatNumber(client.registry.commands.size)} commands`, type: ActivityType.Playing - }, - { - text: (client) => `${formatNumber(client.channels.cache.size)} channels`, - type: ActivityType.Watching } ];