aboutsummaryrefslogtreecommitdiff
path: root/src/listeners
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-23 22:00:23 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-23 22:00:23 -0500
commitb95f4e00566dc4b99527f6771d56a5e557779e66 (patch)
tree2de597a67c49cc5788ccedd7917075e083643860 /src/listeners
parent084a815f3799764d2dd697e8c693c7f80e0c7ab7 (diff)
downloadtanzanite-b95f4e00566dc4b99527f6771d56a5e557779e66.tar.gz
tanzanite-b95f4e00566dc4b99527f6771d56a5e557779e66.tar.bz2
tanzanite-b95f4e00566dc4b99527f6771d56a5e557779e66.zip
feat: prefer bold over inline codeblocks
Diffstat (limited to 'src/listeners')
-rw-r--r--src/listeners/client/interactionCreate.ts2
-rw-r--r--src/listeners/commands/commandBlocked.ts13
-rw-r--r--src/listeners/commands/commandError.ts8
-rw-r--r--src/listeners/commands/commandMissingPermissions.ts6
4 files changed, 14 insertions, 15 deletions
diff --git a/src/listeners/client/interactionCreate.ts b/src/listeners/client/interactionCreate.ts
index 40315a0..d123e09 100644
--- a/src/listeners/client/interactionCreate.ts
+++ b/src/listeners/client/interactionCreate.ts
@@ -29,7 +29,7 @@ export default class InteractionCreateListener extends BushListener {
content: `You selected ${
Array.isArray(interaction.values)
? util.oxford(util.surroundArray(interaction.values, '`'), 'and', '')
- : `\`${interaction.values}\``
+ : util.format.input(interaction.values)
}.`,
ephemeral: true
});
diff --git a/src/listeners/commands/commandBlocked.ts b/src/listeners/commands/commandBlocked.ts
index c80b99a..5724d33 100644
--- a/src/listeners/commands/commandBlocked.ts
+++ b/src/listeners/commands/commandBlocked.ts
@@ -50,9 +50,9 @@ export default class CommandBlockedListener extends BushListener {
}
case reasons.DISABLED_GUILD: {
return await respond({
- content: `${util.emojis.error} The ${util.format.input(command!.toString())} command is currently disabled in \`${
- message.guild?.name
- }\`.`,
+ content: `${util.emojis.error} The ${util.format.input(
+ command!.toString()
+ )} command is currently disabled in ${util.format.input(message.guild!.name)}.`,
ephemeral: true
});
}
@@ -96,10 +96,7 @@ export default class CommandBlockedListener extends BushListener {
case reasons.RESTRICTED_GUILD: {
if (!command) break;
const guilds = command.restrictedGuilds;
- const names: string[] = [];
- guilds!.forEach((g) => {
- names.push(`\`${client.guilds.cache.get(g)?.name}\``);
- });
+ 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}.`,
@@ -108,7 +105,7 @@ export default class CommandBlockedListener extends BushListener {
}
default: {
return await respond({
- content: `${util.emojis.error} Command blocked with reason \`${reason}\``,
+ content: `${util.emojis.error} Command blocked with reason ${util.format.input(reason ?? 'unknown')}.`,
ephemeral: true
});
}
diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts
index 78bb165..0dfd723 100644
--- a/src/listeners/commands/commandError.ts
+++ b/src/listeners/commands/commandError.ts
@@ -125,8 +125,10 @@ export default class CommandErrorListener extends BushListener {
.setTitle('An Error Occurred')
.setDescription(
`Oh no! ${
- options.command ? `While running the ${options.isSlash ? 'slash ' : ''}command \`${options.command.id}\`, a` : 'A'
- }n error occurred. Please give the developers code \`${options.errorNum}\`.`
+ options.command
+ ? `While running the ${options.isSlash ? 'slash ' : ''}command ${util.format.input(options.command.id)}, a`
+ : 'A'
+ }n error occurred. Please give the developers code ${util.format.input(`${options.errorNum}`)}.`
);
}
const description = new Array<string>();
@@ -147,7 +149,7 @@ export default class CommandErrorListener extends BushListener {
if (description.length) embed.setDescription(description.join('\n').substring(0, 4000));
if (options.type === 'command-dev' || options.type === 'command-log')
- embed.setTitle(`${options.isSlash ? 'Slash ' : ''}CommandError #\`${options.errorNum}\``);
+ embed.setTitle(`${options.isSlash ? 'Slash ' : ''}CommandError #${util.format.input(`${options.errorNum}`)}`);
else if (options.type === 'uncaughtException')
embed.setTitle(`${options.context ? `[${Formatters.bold(options.context)}] An Error Occurred` : 'Uncaught Exception'}`);
else if (options.type === 'unhandledRejection')
diff --git a/src/listeners/commands/commandMissingPermissions.ts b/src/listeners/commands/commandMissingPermissions.ts
index e84d58c..19c0860 100644
--- a/src/listeners/commands/commandMissingPermissions.ts
+++ b/src/listeners/commands/commandMissingPermissions.ts
@@ -34,9 +34,9 @@ export default class CommandMissingPermissionsListener extends BushListener {
if (type == 'client') {
return await message.util
.reply(
- `${util.emojis.error} I am missing the ${discordFormat} permission${missing.length ? 's' : ''} required for the \`${
- command?.id
- }\` command.`
+ `${util.emojis.error} I am missing the ${discordFormat} permission${
+ missing.length ? 's' : ''
+ } required for the ${util.format.input(command?.id)} command.`
)
.catch(() => {});
} else if (type == 'user') {