aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/listeners/commands')
-rw-r--r--src/listeners/commands/commandBlocked.ts4
-rw-r--r--src/listeners/commands/commandError.ts10
2 files changed, 8 insertions, 6 deletions
diff --git a/src/listeners/commands/commandBlocked.ts b/src/listeners/commands/commandBlocked.ts
index 2dfe4cd..c80b99a 100644
--- a/src/listeners/commands/commandBlocked.ts
+++ b/src/listeners/commands/commandBlocked.ts
@@ -116,7 +116,9 @@ export default class CommandBlockedListener extends BushListener {
// some inhibitors do not have message.util yet
function respond(content: string | MessagePayload | ReplyMessageOptions | InteractionReplyOptions) {
- return message.util ? message.util.reply(content) : message.reply(content);
+ return message.util
+ ? message.util.reply(<string | MessagePayload | ReplyMessageOptions>content)
+ : message.reply(<string | MessagePayload | (ReplyMessageOptions & InteractionReplyOptions)>content);
}
}
}
diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts
index 44d20a4..bd1ae7d 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 { Formatters, GuildTextBasedChannel, MessageEmbed, type Message } from 'discord.js';
+import { Embed, Formatters, GuildTextBasedChannel, type Message } from 'discord.js';
import { BushListener } from '../../lib/extensions/discord-akairo/BushListener.js';
export default class CommandErrorListener extends BushListener {
@@ -90,7 +90,7 @@ export default class CommandErrorListener extends BushListener {
channel?: string;
}
| { error: Error | any; type: 'uncaughtException' | 'unhandledRejection'; context?: string }
- ): Promise<MessageEmbed> {
+ ): Promise<Embed> {
const _haste = CommandErrorListener.getErrorHaste(options.error);
const _stack = CommandErrorListener.getErrorStack(options.error);
const [haste, stack] = await Promise.all([_haste, _stack]);
@@ -118,8 +118,8 @@ export default class CommandErrorListener extends BushListener {
haste: string[];
stack: string;
}
- ): MessageEmbed {
- const embed = new MessageEmbed().setColor(util.colors.error).setTimestamp();
+ ): Embed {
+ const embed = new Embed().setColor(util.colors.error).setTimestamp();
if (options.type === 'command-user') {
return embed
.setTitle('An Error Occurred')
@@ -143,7 +143,7 @@ export default class CommandErrorListener extends BushListener {
description.push(...options.haste);
- embed.addField('Stack Trace', options.stack).setDescription(description.join('\n'));
+ embed.addField({ name: 'Stack Trace', value: options.stack }).setDescription(description.join('\n'));
if (options.type === 'command-dev' || options.type === 'command-log')
embed.setTitle(`${options.isSlash ? 'Slash ' : ''}CommandError #\`${options.errorNum}\``);