aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/commands
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-03-05 15:20:08 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-03-05 15:20:08 -0500
commit1947c715f5ff846316b2d921b78f1a71a2892d1b (patch)
treef6bdc2d28537fd63f7e8c26db1cb4928cb9c9f13 /src/listeners/commands
parent3c56bbcf795725b65192409b3211d92c097f8c82 (diff)
downloadtanzanite-1947c715f5ff846316b2d921b78f1a71a2892d1b.tar.gz
tanzanite-1947c715f5ff846316b2d921b78f1a71a2892d1b.tar.bz2
tanzanite-1947c715f5ff846316b2d921b78f1a71a2892d1b.zip
chore: upgrade deps
Diffstat (limited to 'src/listeners/commands')
-rw-r--r--src/listeners/commands/commandError.ts8
-rw-r--r--src/listeners/commands/commandStarted.ts14
2 files changed, 10 insertions, 12 deletions
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 : (<GuildTextBasedChannel>message.channel)?.name;
+ const channel = message.channel?.isDM() ? message.channel.recipient?.tag : (<GuildTextBasedChannel>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 : (<GuildTextBasedChannel>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
- : (<GuildTextBasedChannel>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
}
});