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/commands/dev/superUser.ts | 8 +++++--- src/commands/leveling/setLevel.ts | 8 ++++---- src/commands/leveling/setXp.ts | 8 ++++---- src/commands/moderation/evidence.ts | 2 +- src/commands/moderation/hideCase.ts | 2 +- src/commands/moderation/removeReactionEmoji.ts | 8 ++++++-- src/commands/moderation/slowmode.ts | 4 ++-- src/commands/moulberry-bush/capePermissions.ts | 8 ++++++-- src/commands/moulberry-bush/capes.ts | 2 +- src/listeners/client/interactionCreate.ts | 2 +- src/listeners/commands/commandBlocked.ts | 13 +++++-------- src/listeners/commands/commandError.ts | 8 +++++--- src/listeners/commands/commandMissingPermissions.ts | 6 +++--- 13 files changed, 44 insertions(+), 35 deletions(-) diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts index 56bc4b1..ce23da5 100644 --- a/src/commands/dev/superUser.ts +++ b/src/commands/dev/superUser.ts @@ -63,19 +63,21 @@ export default class SuperUserCommand extends BushCommand { const superUsers: string[] = util.getShared('superUsers'); if (action === 'add' ? superUsers.includes(user.id) : !superUsers.includes(user.id)) - return message.util.reply(`${util.emojis.warn} \`${user.tag}\` is ${action === 'add' ? 'already' : 'not'} a superuser.`); + return message.util.reply( + `${util.emojis.warn} ${util.format.input(user.tag)} is ${action === 'add' ? 'already' : 'not'} a superuser.` + ); const success = await util.insertOrRemoveFromShared(action, 'superUsers', user.id).catch(() => false); if (success) { return await message.util.reply( - `${util.emojis.success} ${action == 'remove' ? '' : 'made'} \`${user.tag}\` ${ + `${util.emojis.success} ${action == 'remove' ? '' : 'made'} ${util.format.input(user.tag)} ${ action == 'remove' ? 'is no longer ' : '' }a superuser.` ); } else { return await message.util.reply( - `${util.emojis.error} There was an error ${action == 'remove' ? `removing` : 'making'} \`${user.tag}\` ${ + `${util.emojis.error} There was an error ${action == 'remove' ? `removing` : 'making'} ${util.format.input(user.tag)} ${ action == 'remove' ? `from` : 'to' } the superuser list.` ); diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts index e74d885..30bbb72 100644 --- a/src/commands/leveling/setLevel.ts +++ b/src/commands/leveling/setLevel.ts @@ -45,7 +45,7 @@ export default class SetLevelCommand extends BushCommand { if (isNaN(level) || !Number.isInteger(level)) return await message.util.reply(`${util.emojis.error} Provide a valid number to set the user's level to.`); if (level > 6553 || level < 0) - return await message.util.reply(`${util.emojis.error} You cannot set a level higher than \`6553\`.`); + return await message.util.reply(`${util.emojis.error} You cannot set a level higher than **6553**.`); const [levelEntry] = await Level.findOrBuild({ where: { @@ -60,9 +60,9 @@ export default class SetLevelCommand extends BushCommand { }); await levelEntry.update({ xp: Level.convertLevelToXp(level), user: user.id, guild: message.guild.id }); return await message.util.send({ - content: `Successfully set level of <@${ - user.id - }> to \`${level.toLocaleString()}\` (\`${levelEntry.xp.toLocaleString()}\` XP)`, + content: `Successfully set level of <@${user.id}> to ${util.format.input(level.toLocaleString())} (${util.format.input( + levelEntry.xp.toLocaleString() + )} XP)`, allowedMentions: AllowedMentions.none() }); } diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index 7b1b432..e26cdcc 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -46,7 +46,7 @@ export default class SetXpCommand extends BushCommand { if (isNaN(xp)) return await message.util.reply(`${util.emojis.error} Provide a valid number.`); if (xp > 2147483647 || xp < 0) return await message.util.reply( - `${util.emojis.error} Provide an positive integer under \`2147483647\` to set the user's xp to.` + `${util.emojis.error} Provide an positive integer under **2,147,483,647** to set the user's xp to.` ); const [levelEntry] = await Level.findOrBuild({ @@ -62,9 +62,9 @@ export default class SetXpCommand extends BushCommand { await levelEntry.update({ xp: xp, user: user.id, guild: message.guild.id }); return await message.util.send({ - content: `Successfully set <@${user.id}>'s xp to \`${levelEntry.xp.toLocaleString()}\` (level \`${Level.convertXpToLevel( - levelEntry.xp - ).toLocaleString()}\`).`, + content: `Successfully set <@${user.id}>'s xp to ${util.format.input( + levelEntry.xp.toLocaleString() + )} (level ${util.format.input(Level.convertXpToLevel(levelEntry.xp).toLocaleString())}).`, allowedMentions: AllowedMentions.none() }); } diff --git a/src/commands/moderation/evidence.ts b/src/commands/moderation/evidence.ts index d189e89..362f471 100644 --- a/src/commands/moderation/evidence.ts +++ b/src/commands/moderation/evidence.ts @@ -85,6 +85,6 @@ export default class EvidenceCommand extends BushCommand { client.emit('bushUpdateModlog', message.member!, entry.id, 'evidence', oldEntry, entry.evidence); - return message.util.reply(`${util.emojis.success} Successfully updated the evidence for case \`${caseID}\`.`); + return message.util.reply(`${util.emojis.success} Successfully updated the evidence for case ${util.format.input(caseID)}.`); } } diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts index d603953..8cec66e 100644 --- a/src/commands/moderation/hideCase.ts +++ b/src/commands/moderation/hideCase.ts @@ -40,6 +40,6 @@ export default class HideCaseCommand extends BushCommand { client.emit('bushUpdateModlog', message.member!, entry.id, 'hidden', oldEntry, entry.hidden); - return await message.util.reply(`${util.emojis.success} CaseID \`${caseID}\` is ${action}.`); + return await message.util.reply(`${util.emojis.success} CaseID ${util.format.input(caseID)} is ${action}.`); } } diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts index f511007..b059bff 100644 --- a/src/commands/moderation/removeReactionEmoji.ts +++ b/src/commands/moderation/removeReactionEmoji.ts @@ -53,11 +53,15 @@ export default class RemoveReactionEmojiCommand extends BushCommand { if (success) { return await message.util.reply( - `${util.emojis.success} Removed all reactions of \`${emojiID}\` from the message with the id of \`${resolvedMessage.id}\`.` + `${util.emojis.success} Removed all reactions of ${util.format.input( + emojiID! + )} from the message with the id of ${util.format.input(resolvedMessage.id)}.` ); } else { return await message.util.reply( - `${util.emojis.error} There was an error removing all reactions of \`${emojiID}\` from the message with the id of \`${resolvedMessage.id}\`.` + `${util.emojis.error} There was an error removing all reactions of ${util.format.input( + emojiID! + )} from the message with the id of ${util.format.input(resolvedMessage.id)}.` ); } } diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index c0511f3..6d93ede 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -70,8 +70,8 @@ export default class SlowmodeCommand extends BushCommand { else return await message.util.reply( `${util.emojis.success} Successfully changed the slowmode of <#${args.channel.id}> ${ - length2 ? `to \`${util.humanizeDuration(length2)}` : '`off' - }\`.` + length2 ? `to ${util.format.input(util.humanizeDuration(length2))}` : '**off**' + }.` ); } } diff --git a/src/commands/moulberry-bush/capePermissions.ts b/src/commands/moulberry-bush/capePermissions.ts index edb2836..7bf3926 100644 --- a/src/commands/moulberry-bush/capePermissions.ts +++ b/src/commands/moulberry-bush/capePermissions.ts @@ -43,7 +43,9 @@ export default class CapePermissionsCommand extends BushCommand { capePerms = null; } if (capePerms == null) { - return await message.util.reply(`${util.emojis.error} There was an error finding cape perms for \`${args.ign}\`.`); + return await message.util.reply( + `${util.emojis.error} There was an error finding cape perms for ${util.format.input(args.ign)}.` + ); } else { if (capePerms?.perms) { let index = null; @@ -56,7 +58,9 @@ export default class CapePermissionsCommand extends BushCommand { continue; } if (index == null) - return await message.util.reply(`${util.emojis.error} \`${args.ign}\` does not appear to have any capes.`); + return await message.util.reply( + `${util.emojis.error} ${util.format.input(args.ign)} does not appear to have any capes.` + ); const userPerm: string[] = capePerms.perms[index].perms; const embed = new Embed() .setTitle(`${args.ign}'s Capes`) diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 551a5c6..ab9e8a7 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -68,7 +68,7 @@ export default class CapesCommand extends BushCommand { const embed = this.makeEmbed(cape); await DeleteButton.send(message, { embeds: [embed] }); } else { - await message.util.reply(`${util.emojis.error} Cannot find a cape called \`${args.cape}\`.`); + await message.util.reply(`${util.emojis.error} Cannot find a cape called ${util.format.input(args.cape)}.`); } } else { const embeds: APIEmbed[] = capes.map(this.makeEmbed); 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(); @@ -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