diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-27 13:12:49 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-27 13:12:49 -0500 |
commit | e05f25f4b98cac3c2409cee9a664ab5ea6251467 (patch) | |
tree | f8e3dc4fde8f6deaa543b910acb9a725abbac999 /src/commands/leveling | |
parent | 84f246ebb5ddee984012d3043dcc67ffae806856 (diff) | |
download | tanzanite-e05f25f4b98cac3c2409cee9a664ab5ea6251467.tar.gz tanzanite-e05f25f4b98cac3c2409cee9a664ab5ea6251467.tar.bz2 tanzanite-e05f25f4b98cac3c2409cee9a664ab5ea6251467.zip |
better typings and some other stuff
Diffstat (limited to 'src/commands/leveling')
-rw-r--r-- | src/commands/leveling/leaderboard.ts | 4 | ||||
-rw-r--r-- | src/commands/leveling/level.ts | 3 | ||||
-rw-r--r-- | src/commands/leveling/setLevel.ts | 8 | ||||
-rw-r--r-- | src/commands/leveling/setXp.ts | 8 |
4 files changed, 14 insertions, 9 deletions
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts index 6bf66d1..d53d358 100644 --- a/src/commands/leveling/leaderboard.ts +++ b/src/commands/leveling/leaderboard.ts @@ -1,4 +1,4 @@ -import { BushCommand, ButtonPaginator, Level, type BushMessage, type BushSlashMessage } from '#lib'; +import { ArgType, BushCommand, ButtonPaginator, Level, type BushMessage, type BushSlashMessage } from '#lib'; import { MessageEmbed } from 'discord.js'; export default class LeaderboardCommand extends BushCommand { @@ -27,7 +27,7 @@ export default class LeaderboardCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { page: number }) { + public override async exec(message: BushMessage | BushSlashMessage, args: { page: ArgType<'integer'> }) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); if (!(await message.guild.hasFeature('leveling'))) return await message.util.reply( diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts index 61e5d0b..ed8466d 100644 --- a/src/commands/leveling/level.ts +++ b/src/commands/leveling/level.ts @@ -1,5 +1,6 @@ import { AllowedMentions, + ArgType, BushCommand, CanvasProgressBar, Level, @@ -41,7 +42,7 @@ export default class LevelCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { user?: BushUser }) { + public override async exec(message: BushMessage | BushSlashMessage, args: { user?: ArgType<'user'> }) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); if (!(await message.guild.hasFeature('leveling'))) return await message.util.reply( diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts index 69f562d..5118a8b 100644 --- a/src/commands/leveling/setLevel.ts +++ b/src/commands/leveling/setLevel.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, Level, type BushMessage, type BushSlashMessage } from '#lib'; -import { type User } from 'discord.js'; +import { AllowedMentions, ArgType, BushCommand, Level, type BushMessage, type BushSlashMessage } from '#lib'; export default class SetLevelCommand extends BushCommand { public constructor() { @@ -34,7 +33,10 @@ export default class SetLevelCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, { user, level }: { user: User; level: number }) { + public override async exec( + message: BushMessage | BushSlashMessage, + { user, level }: { user: ArgType<'user'>; level: ArgType<'integer'> } + ) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a guild.`); if (!user.id) throw new Error('user.id is null'); diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index 68be528..eeafff3 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -1,5 +1,4 @@ -import { AllowedMentions, BushCommand, Level, type BushMessage, type BushSlashMessage } from '#lib'; -import { type User } from 'discord.js'; +import { AllowedMentions, ArgType, BushCommand, Level, type BushMessage, type BushSlashMessage } from '#lib'; export default class SetXpCommand extends BushCommand { public constructor() { @@ -35,7 +34,10 @@ export default class SetXpCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, { user, xp }: { user: User; xp: number }) { + public override async exec( + message: BushMessage | BushSlashMessage, + { user, xp }: { user: ArgType<'user'>; xp: ArgType<'abbreviatedNumber'> } + ) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a guild.`); if (!user.id) throw new Error('user.id is null'); |