diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
commit | d40527d0a2d9f209905750258f71bedff1cdf089 (patch) | |
tree | e017fd844c2135bfc85228d00ef2617d24ce0a3f /src/commands/info/help.ts | |
parent | d431ad00754f3f250103deedea495b9bcee73fc0 (diff) | |
download | tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2 tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip |
turned on ts strict option
Diffstat (limited to 'src/commands/info/help.ts')
-rw-r--r-- | src/commands/info/help.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 691051c..97811da 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -47,7 +47,7 @@ export default class HelpCommand extends BushCommand { message: BushMessage | BushSlashMessage, args: { command: BushCommand | string; showHidden?: boolean } ): Promise<unknown> { - const prefix = client.config.isDevelopment ? 'dev ' : message.util.parsed.prefix; + const prefix = client.config.isDevelopment ? 'dev ' : message.util.parsed?.prefix ?? client.config.prefix; const row = new MessageActionRow(); if (!client.config.isDevelopment && !client.guilds.cache.some((guild) => guild.ownerId === message.author.id)) { @@ -55,11 +55,13 @@ export default class HelpCommand extends BushCommand { new MessageButton({ style: 'LINK', label: 'Invite Me', - url: `https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=2147483647&scope=bot%20applications.commands` + url: `https://discord.com/api/oauth2/authorize?client_id=${ + client.user!.id + }&permissions=2147483647&scope=bot%20applications.commands` }) ); } - if (!client.guilds.cache.get(client.config.supportGuild.id).members.cache.has(message.author.id)) { + if (!client.guilds.cache.get(client.config.supportGuild.id)?.members.cache.has(message.author.id)) { row.addComponents( new MessageButton({ style: 'LINK', @@ -80,7 +82,7 @@ export default class HelpCommand extends BushCommand { const isSuperUser = client.isSuperUser(message.author); const command = args.command ? typeof args.command === 'string' - ? client.commandHandler.modules.get(args.command) || null + ? client.commandHandler.modules.get(args.command) ?? null : args.command : null; if (!isOwner) args.showHidden = false; @@ -98,7 +100,8 @@ export default class HelpCommand extends BushCommand { if (command.superUserOnly && !isSuperUser) { return false; } - return !(command.restrictedGuilds?.includes(message.guild.id) === false && !args.showHidden); + // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain + return !(command.restrictedGuilds?.includes(message.guild?.id!) === false && !args.showHidden); }); const categoryNice = category.id .replace(/(\b\w)/gi, (lc): string => lc.toUpperCase()) |