aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/config/blacklist.ts4
-rw-r--r--src/commands/dev/eval.ts16
-rw-r--r--src/commands/info/help.ts6
3 files changed, 16 insertions, 10 deletions
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts
index 8e5d703..ae19d70 100644
--- a/src/commands/config/blacklist.ts
+++ b/src/commands/config/blacklist.ts
@@ -102,8 +102,8 @@ export default class BlacklistCommand extends BushCommand {
});
// guild disable
} else {
- const blacklistedChannels = await message.guild.getSetting('blacklistedChannels');
- const blacklistedUsers = await message.guild.getSetting('blacklistedUsers');
+ const blacklistedChannels = await message.guild.getSetting('blacklistedChannels')??[];
+ const blacklistedUsers = await message.guild.getSetting('blacklistedUsers')??[];
if (action === 'toggle') {
action = blacklistedChannels.includes(targetID) ?? blacklistedUsers.includes(targetID) ? 'unblacklist' : 'blacklist';
}
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 436268e..0de0aa1 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -1,5 +1,3 @@
-/* eslint-disable @typescript-eslint/no-var-requires */
-/* eslint-disable @typescript-eslint/no-unused-vars */
import { BushCommand, BushMessage, BushSlashMessage } from '@lib';
import { exec } from 'child_process';
import { Constants } from 'discord-akairo';
@@ -12,7 +10,6 @@ const clean = (text) => {
return Util.cleanCodeBlockContent(text);
} else return text;
};
-const sh = promisify(exec);
export default class EvalCommand extends BushCommand {
public constructor() {
@@ -173,7 +170,9 @@ export default class EvalCommand extends BushCommand {
try {
let output;
- const me = message.member,
+ /* eslint-disable @typescript-eslint/no-unused-vars */
+ const sh = promisify(exec),
+ me = message.member,
member = message.member,
bot = this.client,
guild = message.guild,
@@ -193,12 +192,15 @@ export default class EvalCommand extends BushCommand {
MessageAttachment,
MessageButton,
MessageCollector,
- MessageComponentInteractionCollector,
+ InteractionCollector,
MessageEmbed,
MessageSelectMenu,
ReactionCollector,
- Util
- } = require('discord.js'); // I would use import here but esbuild doesn't like that
+ Util,
+ Collection
+ } = await import('discord.js'),
+ { Canvas } = await import('node-canvas');
+ /* eslint-enable @typescript-eslint/no-unused-vars */
if (code[code.lang].replace(/ /g, '').includes('9+10' || '10+9')) {
output = 21;
} else {
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index e485d24..1786f8c 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -48,7 +48,7 @@ export default class HelpCommand extends BushCommand {
): Promise<unknown> {
const prefix = this.client.config.isDevelopment ? 'dev ' : message.util.parsed.prefix;
const components =
- !this.client.config.isDevelopment || !this.client.guilds.cache.some((guild) => guild.ownerId === message.author.id)
+ !this.client.config.isDevelopment && !this.client.guilds.cache.some((guild) => guild.ownerId === message.author.id)
? [
new MessageActionRow().addComponents(
new MessageButton({
@@ -60,6 +60,10 @@ export default class HelpCommand extends BushCommand {
]
: undefined;
+ this.client.console.debug(!this.client.config.isDevelopment);
+ this.client.console.debug(!this.client.guilds.cache.some((guild) => guild.ownerId === message.author.id));
+ this.client.console.debug(components);
+
const isOwner = this.client.isOwner(message.author);
const isSuperUser = this.client.isSuperUser(message.author);
const command = args.command