diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-01 17:24:16 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-01 17:24:16 -0400 |
commit | 4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd (patch) | |
tree | 7ef72c3c3ff9d3a896d8781c5c54b7303d4e5a29 /src/commands/leveling | |
parent | d7099571b90c4211f90089bb41e90b0a08b86112 (diff) | |
download | tanzanite-4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd.tar.gz tanzanite-4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd.tar.bz2 tanzanite-4c3474c63dc3c5deb5bc1dd9f37cc9d5812b62fd.zip |
chore: fromatting fixes, refactor ping command, hopefully fix duration rounding issues
Diffstat (limited to 'src/commands/leveling')
-rw-r--r-- | src/commands/leveling/levelRoles.ts | 2 | ||||
-rw-r--r-- | src/commands/leveling/setLevel.ts | 13 | ||||
-rw-r--r-- | src/commands/leveling/setXp.ts | 11 |
3 files changed, 7 insertions, 19 deletions
diff --git a/src/commands/leveling/levelRoles.ts b/src/commands/leveling/levelRoles.ts index 6886337..9fe7dd0 100644 --- a/src/commands/leveling/levelRoles.ts +++ b/src/commands/leveling/levelRoles.ts @@ -49,7 +49,7 @@ export default class LevelRolesCommand extends BushCommand { 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 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 than **1**.`); if (args.role) { if (args.role.managed) diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts index 30bbb72..ac7df57 100644 --- a/src/commands/leveling/setLevel.ts +++ b/src/commands/leveling/setLevel.ts @@ -45,18 +45,11 @@ 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 **6,553**.`); const [levelEntry] = await Level.findOrBuild({ - where: { - user: user.id, - guild: message.guild.id - }, - defaults: { - user: user.id, - guild: message.guild.id, - xp: 0 - } + where: { user: user.id, guild: message.guild.id }, + defaults: { user: user.id, guild: message.guild.id, xp: 0 } }); await levelEntry.update({ xp: Level.convertLevelToXp(level), user: user.id, guild: message.guild.id }); return await message.util.send({ diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index e26cdcc..1f7c981 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -50,17 +50,12 @@ export default class SetXpCommand extends BushCommand { ); const [levelEntry] = await Level.findOrBuild({ - where: { - user: user.id, - guild: message.guild.id - }, - defaults: { - user: user.id, - guild: message.guild.id - } + where: { user: user.id, guild: message.guild.id }, + defaults: { user: user.id, guild: message.guild.id } }); 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 ${util.format.input( levelEntry.xp.toLocaleString() |