diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-27 19:14:44 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-27 19:14:44 -0400 |
commit | 2db1d85a24c8a4d7e519d527e5bdb8fa469c4c85 (patch) | |
tree | 7a86903c52ff051dca6ce8b1406e0bf0d693e819 /src/commands | |
parent | 85623caadc009423a999949880de12a386f335c2 (diff) | |
download | tanzanite-2db1d85a24c8a4d7e519d527e5bdb8fa469c4c85.tar.gz tanzanite-2db1d85a24c8a4d7e519d527e5bdb8fa469c4c85.tar.bz2 tanzanite-2db1d85a24c8a4d7e519d527e5bdb8fa469c4c85.zip |
fix: replace '{error}' in retry prompts
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/fun/minesweeper.ts | 2 | ||||
-rw-r--r-- | src/commands/leveling/levelRoles.ts | 56 |
2 files changed, 22 insertions, 36 deletions
diff --git a/src/commands/fun/minesweeper.ts b/src/commands/fun/minesweeper.ts index 41daa8e..72551e9 100644 --- a/src/commands/fun/minesweeper.ts +++ b/src/commands/fun/minesweeper.ts @@ -56,7 +56,7 @@ export default class MinesweeperCommand extends BushCommand { id: 'do_not_reveal_first_cell', description: 'Whether to not reveal the first cell automatically.', match: 'flag', - flag: '--doNotRevealFirstCell', + flag: ['--doNotRevealFirstCell', 'do_not_reveal_first_cell'], prompt: 'Would you like to not automatically reveal the first cell?', slashType: ApplicationCommandOptionType.Boolean, optional: true diff --git a/src/commands/leveling/levelRoles.ts b/src/commands/leveling/levelRoles.ts index 893e602..3d95933 100644 --- a/src/commands/leveling/levelRoles.ts +++ b/src/commands/leveling/levelRoles.ts @@ -46,34 +46,20 @@ export default class LevelRolesCommand extends BushCommand { assert(message.member); if (!(await message.guild.hasFeature('leveling'))) { - return await message.util.reply( - `${util.emojis.error} This command can only be run in servers with the leveling feature enabled.` - ); + return await reply(`${util.emojis.error} This command can only be run in servers with the leveling feature enabled.`); } - if (args.level < 1) return await message.util.reply(`${util.emojis.error} You cannot set a level role less that 1.`); + if (args.level < 1) return await reply(`${util.emojis.error} You cannot set a level role less that 1.`); if (args.role) { if (args.role.managed) - return await message.util.reply({ - content: `${util.emojis.error} You cannot set <@${args.role.id}> as a level role since it is managed.`, - allowedMentions: AllowedMentions.none() - }); + return await reply(`${util.emojis.error} You cannot set <@${args.role.id}> as a level role since it is managed.`); else if (args.role.id === message.guild.id) - return await message.util.reply({ - content: `${util.emojis.error} You cannot set the @everyone role as a level role.`, - allowedMentions: AllowedMentions.none() - }); + return await reply(`${util.emojis.error} You cannot set the @everyone role as a level role.`); else if (args.role.comparePositionTo(message.member.roles.highest) >= 0) - return await message.util.reply({ - content: `${util.emojis.error} <@${args.role.id}> is higher or equal to your highest role.`, - allowedMentions: AllowedMentions.none() - }); + return await reply(`${util.emojis.error} <@${args.role.id}> is higher or equal to your highest role.`); else if (args.role.comparePositionTo(message.guild.members.me!.roles.highest) >= 0) - return await message.util.reply({ - content: `${util.emojis.error} <@${args.role.id}> is higher or equal to my highest role.`, - allowedMentions: AllowedMentions.none() - }); + return await reply(`${util.emojis.error} <@${args.role.id}> is higher or equal to my highest role.`); } const oldRoles = Object.freeze(await message.guild.getSetting('levelRoles')); @@ -88,25 +74,25 @@ export default class LevelRolesCommand extends BushCommand { const success = await message.guild.setSetting('levelRoles', newRoles, message.member).catch(() => false); - if (!success) return await message.util.reply(`${util.emojis.error} An error occurred while setting the level roles.`); + if (!success) return await reply(`${util.emojis.error} An error occurred while setting the level roles.`); if (!oldRoles[args.level] && newRoles[args.level]) { - return await message.util.reply({ - content: `${util.emojis.success} The level role for **${args.level}** is now <@&${newRoles[args.level]}>.`, - allowedMentions: AllowedMentions.none() - }); + return await reply(`${util.emojis.success} The level role for **${args.level}** is now <@&${newRoles[args.level]}>.`); } else if (oldRoles[args.level] && !newRoles[args.level]) { - return await message.util.reply({ - content: `${util.emojis.success} The level role for **${args.level}** was <@&${ - oldRoles[args.level] - }> but is now disabled.`, - allowedMentions: AllowedMentions.none() - }); + return await reply( + `${util.emojis.success} The level role for **${args.level}** was <@&${oldRoles[args.level]}> but is now disabled.` + ); } else if (oldRoles[args.level] && newRoles[args.level]) { - return await message.util.reply({ - content: `${util.emojis.success} The level role for **${args.level}** has been updated from <@&${ - oldRoles[args.level] - }> to <@&${newRoles[args.level]}>.`, + return await reply( + `${util.emojis.success} The level role for **${args.level}** has been updated from <@&${oldRoles[args.level]}> to <@&${ + newRoles[args.level] + }>.` + ); + } + + function reply(str: string) { + return message.util.reply({ + content: str, allowedMentions: AllowedMentions.none() }); } |