1
0
Fork 0

args check

refactor/models
Matthew 2020-11-09 23:56:56 -05:00
parent 12cbb86f3f
commit 449eb8f501
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 2 additions and 2 deletions

View File

@ -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.***`);