From 1947c715f5ff846316b2d921b78f1a71a2892d1b Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 5 Mar 2022 15:20:08 -0500 Subject: chore: upgrade deps --- src/listeners/commands/commandError.ts | 8 ++++---- src/listeners/commands/commandStarted.ts | 14 ++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src/listeners/commands') diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts index 83bb327..048c597 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/commandError.ts @@ -22,7 +22,7 @@ export default class CommandErrorListener extends BushListener { try { const isSlash = message.util.isSlash; const errorNum = Math.floor(Math.random() * 6969696969) + 69; // hehe funny number - const channel = message.channel?.isDM() ? message.channel?.recipient.tag : (message.channel)?.name; + const channel = message.channel?.isDM() ? message.channel.recipient?.tag : (message.channel)?.name; const command = _command ?? message.util.parsed?.command; client.sentry.captureException(error, { @@ -33,10 +33,10 @@ export default class CommandErrorListener 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.id': (message.channel?.isDM() ? message.channel.recipient?.id : message.channel?.id) ?? '¯_(ツ)_/¯', 'channel.name': channel, - 'guild.id': message.guild?.id, - 'guild.name': message.guild?.name, + 'guild.id': message.guild?.id ?? '¯_(ツ)_/¯', + 'guild.name': message.guild?.name ?? '¯_(ツ)_/¯', 'environment': client.config.environment } }); diff --git a/src/listeners/commands/commandStarted.ts b/src/listeners/commands/commandStarted.ts index 419191a..833eff0 100644 --- a/src/listeners/commands/commandStarted.ts +++ b/src/listeners/commands/commandStarted.ts @@ -1,6 +1,6 @@ import { BushListener, type BushCommandHandlerEvents } from '#lib'; import { Severity } from '@sentry/types'; -import { ChannelType, GuildTextBasedChannel } from 'discord.js'; +import { ChannelType } from 'discord.js'; export default class CommandStartedListener extends BushListener { public constructor() { @@ -20,13 +20,11 @@ export default class CommandStartedListener extends BushListener { 'command.name': command?.id, 'message.id': message.id, 'message.type': message.util.isSlash ? 'slash' : 'normal', - 'message.parsed.content': message.util.parsed!.content, - '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, + 'message.parsed.content': message.util.parsed?.content, + '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