aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling/level.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-19 18:52:41 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-19 18:52:41 -0500
commite78beed6c7e094ef48aad5d18da01b2bbed4536c (patch)
tree32676793af5f7bdc39d438ff284fa5b959274e96 /src/commands/leveling/level.ts
parenta3103b629250de3fb97a40a4f9ff7e7ba28f4d16 (diff)
downloadtanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.gz
tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.bz2
tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.zip
fix: a ton of shit
Diffstat (limited to 'src/commands/leveling/level.ts')
-rw-r--r--src/commands/leveling/level.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts
index 271c3f6..803703e 100644
--- a/src/commands/leveling/level.ts
+++ b/src/commands/leveling/level.ts
@@ -47,7 +47,8 @@ export default class LevelCommand extends BushCommand {
}
public override async exec(message: BushMessage | BushSlashMessage, args: { user: OptionalArgType<'user'> }) {
- if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`);
+ assert(message.inGuild());
+
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.${
@@ -59,7 +60,7 @@ export default class LevelCommand extends BushCommand {
const user = args.user ?? message.author;
try {
return await message.util.reply({
- files: [new MessageAttachment(await this.getImage(user, message.guild!), 'level.png')]
+ files: [new MessageAttachment(await this.getImage(user, message.guild), 'level.png')]
});
} catch (e) {
if (e instanceof Error && e.message === 'User does not have a level') {