From b95f4e00566dc4b99527f6771d56a5e557779e66 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:00:23 -0500 Subject: feat: prefer bold over inline codeblocks --- src/listeners/commands/commandBlocked.ts | 13 +++++-------- src/listeners/commands/commandError.ts | 8 +++++--- src/listeners/commands/commandMissingPermissions.ts | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src/listeners/commands') 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(); @@ -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') { -- cgit