From bab76f38a17c62f8c1477172fe1bc9428efb3843 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 31 Jan 2022 19:20:39 -0500 Subject: fixes, and breaking changes --- src/listeners/commands/commandMissingPermissions.ts | 3 ++- src/listeners/commands/commandStarted.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/listeners/commands') diff --git a/src/listeners/commands/commandMissingPermissions.ts b/src/listeners/commands/commandMissingPermissions.ts index 4d9aa1b..e84d58c 100644 --- a/src/listeners/commands/commandMissingPermissions.ts +++ b/src/listeners/commands/commandMissingPermissions.ts @@ -1,4 +1,5 @@ import { BushListener, type BushCommandHandlerEvents } from '#lib'; +import { PermissionsString } from 'discord.js'; export default class CommandMissingPermissionsListener extends BushListener { public constructor() { @@ -18,7 +19,7 @@ export default class CommandMissingPermissionsListener extends BushListener { | BushCommandHandlerEvents['missingPermissions'] | BushCommandHandlerEvents['slashMissingPermissions'] ) { - const niceMissing = (missing.includes('ADMINISTRATOR') ? (['ADMINISTRATOR'] as const) : missing).map( + const niceMissing = (missing.includes('Administrator') ? (['Administrator'] as PermissionsString[]) : missing).map( (perm) => client.consts.mappings.permissions[perm]?.name ?? missing ); diff --git a/src/listeners/commands/commandStarted.ts b/src/listeners/commands/commandStarted.ts index 4917402..419191a 100644 --- a/src/listeners/commands/commandStarted.ts +++ b/src/listeners/commands/commandStarted.ts @@ -21,8 +21,10 @@ export default class CommandStartedListener extends BushListener { 'message.id': message.id, 'message.type': message.util.isSlash ? 'slash' : 'normal', 'message.parsed.content': message.util.parsed!.content, - 'channel.id': message.channel.isDM() ? message.channel!.recipient.id : (message.channel)?.id, - 'channel.name': message.channel.isDM() ? message.channel.recipient.tag : (message.channel)?.name, + 'channel.id': message.channel.isDMBased() ? message.channel!.recipient.id : message.channel?.id, + 'channel.name': message.channel.isDMBased() + ? message.channel.recipient.tag + : (message.channel)?.name, 'guild.id': message.guild?.id, 'guild.name': message.guild?.name, 'environment': client.config.environment -- cgit