diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-24 20:59:37 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-24 20:59:37 -0400 |
commit | a8d2c867ca35ea23d63123136e88730065ec9568 (patch) | |
tree | 9ec59b779da0ffe0f2ea7c6e654aedc81f8b2c3a /src/listeners/commands | |
parent | 9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c (diff) | |
download | tanzanite-a8d2c867ca35ea23d63123136e88730065ec9568.tar.gz tanzanite-a8d2c867ca35ea23d63123136e88730065ec9568.tar.bz2 tanzanite-a8d2c867ca35ea23d63123136e88730065ec9568.zip |
fix: viewraw context command and perfomance
Diffstat (limited to 'src/listeners/commands')
-rw-r--r-- | src/listeners/commands/commandBlocked.ts | 15 | ||||
-rw-r--r-- | src/listeners/commands/commandError.ts | 11 | ||||
-rw-r--r-- | src/listeners/commands/commandStarted.ts | 8 | ||||
-rw-r--r-- | src/listeners/commands/messageBlocked.ts | 3 |
4 files changed, 20 insertions, 17 deletions
diff --git a/src/listeners/commands/commandBlocked.ts b/src/listeners/commands/commandBlocked.ts index 5724d33..0d3c1d9 100644 --- a/src/listeners/commands/commandBlocked.ts +++ b/src/listeners/commands/commandBlocked.ts @@ -5,7 +5,8 @@ export default class CommandBlockedListener extends BushListener { public constructor() { super('commandBlocked', { emitter: 'commandHandler', - event: 'commandBlocked' + event: 'commandBlocked', + category: 'commands' }); } @@ -32,26 +33,26 @@ export default class CommandBlockedListener extends BushListener { switch (reason) { case reasons.OWNER: { return await respond({ - content: `${util.emojis.error} Only my developers can run the ${util.format.input(command!.toString())} command.`, + content: `${util.emojis.error} Only my developers can run the ${util.format.input(command!.id)} command.`, ephemeral: true }); } case reasons.SUPER_USER: { return await respond({ - content: `${util.emojis.error} You must be a superuser to run the ${util.format.input(command!.toString())} command.`, + content: `${util.emojis.error} You must be a superuser to run the ${util.format.input(command!.id)} command.`, ephemeral: true }); } case reasons.DISABLED_GLOBAL: { return await respond({ - content: `${util.emojis.error} My developers disabled the ${util.format.input(command!.toString())} command.`, + content: `${util.emojis.error} My developers disabled the ${util.format.input(command!.id)} command.`, ephemeral: true }); } case reasons.DISABLED_GUILD: { return await respond({ content: `${util.emojis.error} The ${util.format.input( - command!.toString() + command!.id )} command is currently disabled in ${util.format.input(message.guild!.name)}.`, ephemeral: true }); @@ -89,7 +90,7 @@ export default class CommandBlockedListener extends BushListener { }); const pretty = util.oxford(names, 'and'); return await respond({ - content: `${util.emojis.error} ${util.format.input(command!.toString())} can only be run in ${pretty}.`, + content: `${util.emojis.error} ${util.format.input(command!.id)} can only be run in ${pretty}.`, ephemeral: true }); } @@ -99,7 +100,7 @@ export default class CommandBlockedListener extends BushListener { const names = guilds!.map((g) => util.format.input(client.guilds.cache.get(g)?.name ?? g)); const pretty = util.oxford(names, 'and'); return await respond({ - content: `${util.emojis.error} ${util.format.input(command!.toString())} can only be run in ${pretty}.`, + content: `${util.emojis.error} ${util.format.input(command!.id)} can only be run in ${pretty}.`, ephemeral: true }); } diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts index e1acb00..d590e06 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/commandError.ts @@ -8,7 +8,8 @@ export default class CommandErrorListener extends BushListener { public constructor() { super('commandError', { emitter: 'commandHandler', - event: 'error' + event: 'error', + category: 'commands' }); } @@ -33,10 +34,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 } }); @@ -232,7 +233,7 @@ export default class CommandErrorListener extends BushListener { } } -class IFuckedUpError extends Error { +export class IFuckedUpError extends Error { public declare original: Error | any; public declare newError: Error | any; diff --git a/src/listeners/commands/commandStarted.ts b/src/listeners/commands/commandStarted.ts index 4d2f0ad..63b906b 100644 --- a/src/listeners/commands/commandStarted.ts +++ b/src/listeners/commands/commandStarted.ts @@ -21,11 +21,11 @@ export default class CommandStartedListener extends BushListener { '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.id': (message.channel.isDMBased() ? message.channel.recipient?.id : message.channel?.id) ?? '¯\\_(ツ)_/¯', 'channel.name': - (message.channel.isDMBased() ? message.channel.recipient?.tag : (<any>message.channel)?.name) ?? '¯_(ツ)_/¯', - 'guild.id': message.guild?.id ?? '¯_(ツ)_/¯', - 'guild.name': message.guild?.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 } }); diff --git a/src/listeners/commands/messageBlocked.ts b/src/listeners/commands/messageBlocked.ts index 1b969ed..5a2b10d 100644 --- a/src/listeners/commands/messageBlocked.ts +++ b/src/listeners/commands/messageBlocked.ts @@ -4,7 +4,8 @@ export default class MessageBlockedListener extends BushListener { public constructor() { super('messageBlocked', { emitter: 'commandHandler', - event: 'messageBlocked' + event: 'messageBlocked', + category: 'commands' }); } |