aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/commands
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-04-20 18:37:22 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-04-20 18:37:22 -0400
commitf01be2e3ce820e5737416180efa3e5852ece72c4 (patch)
treea972af929940173e4e2d9f843124a8dfb293bc90 /src/listeners/commands
parentbcb3dc5fcd21f7626d4c5a8c009dca5658a4436b (diff)
downloadtanzanite-f01be2e3ce820e5737416180efa3e5852ece72c4.tar.gz
tanzanite-f01be2e3ce820e5737416180efa3e5852ece72c4.tar.bz2
tanzanite-f01be2e3ce820e5737416180efa3e5852ece72c4.zip
fix invite link, remove store channel, update to use builder methods, fix breaking changes
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