From 449eb8f501d4d299e6e23f9f0e749f580fd622cf Mon Sep 17 00:00:00 2001 From: Matthew R Date: Mon, 9 Nov 2020 23:56:56 -0500 Subject: [PATCH] args check --- src/commands/warn.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/warn.ts b/src/commands/warn.ts index 07a7426..3369bce 100644 --- a/src/commands/warn.ts +++ b/src/commands/warn.ts @@ -6,14 +6,14 @@ export default class Warn extends Command { super(client); this.name = 'warn'; this.description = 'Sends an official warning to user.'; - this.usage = `${this.client.config.prefix}warn [username | user ID]`; + this.usage = `${this.client.config.prefix}warn [username | user ID] [reason]`; this.permissions = { roles: ['662163685439045632', '701454780828221450'] }; this.enabled = true; } public async run(message: Message, args: string[]) { try { - if (!args.length) return this.client.commands.get('help').run(message, [this.name]); + if (!args.length || !args[1]) return this.client.commands.get('help').run(message, [this.name]); const edit = await this.loading(message.channel, 'Processing warning...'); const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); if (!account) return edit.edit(`***${this.client.stores.emojis.error} Cannot find user.***`);