aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/dev')
-rw-r--r--src/commands/dev/__template.ts7
-rw-r--r--src/commands/dev/setLevel.ts6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts
index be4f7a7..4cf407c 100644
--- a/src/commands/dev/__template.ts
+++ b/src/commands/dev/__template.ts
@@ -53,7 +53,12 @@ export default class TemplateCommand extends BushCommand {
userPermissions: ['SEND_MESSAGES']
});
}
- public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> {
+
+ public override async exec(
+ message: BushMessage | BushSlashMessage,
+ args: { required_argument: string; optional_argumen: string }
+ ): Promise<unknown> {
return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
+ args;
}
}
diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts
index e69b9df..777ef60 100644
--- a/src/commands/dev/setLevel.ts
+++ b/src/commands/dev/setLevel.ts
@@ -55,15 +55,17 @@ export default class SetLevelCommand extends BushCommand {
): Promise<unknown> {
if (!message.author.isOwner())
return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`);
+ 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');
const [levelEntry] = await Level.findOrBuild({
where: {
user: user.id,
- guild: message.guild!.id
+ guild: message.guild.id
},
defaults: {
user: user.id,
- guild: message.guild!.id
+ guild: message.guild.id
}
});
await levelEntry.update({ xp: Level.convertLevelToXp(level) });