aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/listeners/commands')
-rw-r--r--src/listeners/commands/commandError.ts8
-rw-r--r--src/listeners/commands/commandStarted.ts3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts
index 048c597..6a66375 100644
--- a/src/listeners/commands/commandError.ts
+++ b/src/listeners/commands/commandError.ts
@@ -1,7 +1,7 @@
import { type BushCommandHandlerEvents } from '#lib';
import { Severity } from '@sentry/types';
import { type AkairoMessage, type Command } from 'discord-akairo';
-import { Embed, Formatters, GuildTextBasedChannel, type Message } from 'discord.js';
+import { EmbedBuilder, Formatters, GuildTextBasedChannel, type Message } from 'discord.js';
import { BushListener } from '../../lib/extensions/discord-akairo/BushListener.js';
export default class CommandErrorListener extends BushListener {
@@ -94,7 +94,7 @@ export default class CommandErrorListener extends BushListener {
channel?: string;
}
| { error: Error | any; type: 'uncaughtException' | 'unhandledRejection'; context?: string }
- ): Promise<Embed> {
+ ): Promise<EmbedBuilder> {
const _haste = CommandErrorListener.getErrorHaste(options.error);
const _stack = CommandErrorListener.getErrorStack(options.error);
const [haste, stack] = await Promise.all([_haste, _stack]);
@@ -122,8 +122,8 @@ export default class CommandErrorListener extends BushListener {
haste: string[];
stack: string;
}
- ): Embed {
- const embed = new Embed().setColor(util.colors.error).setTimestamp();
+ ): EmbedBuilder {
+ const embed = new EmbedBuilder().setColor(util.colors.error).setTimestamp();
if (options.type === 'command-user') {
return embed
.setTitle('An Error Occurred')
diff --git a/src/listeners/commands/commandStarted.ts b/src/listeners/commands/commandStarted.ts
index 833eff0..4d2f0ad 100644
--- a/src/listeners/commands/commandStarted.ts
+++ b/src/listeners/commands/commandStarted.ts
@@ -22,7 +22,8 @@ export default class CommandStartedListener extends BushListener {
'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) ?? '¯_(ツ)_/¯',
+ 'channel.name':
+ (message.channel.isDMBased() ? message.channel.recipient?.tag : (<any>message.channel)?.name) ?? '¯_(ツ)_/¯',
'guild.id': message.guild?.id ?? '¯_(ツ)_/¯',
'guild.name': message.guild?.name ?? '¯_(ツ)_/¯',
'environment': client.config.environment