1
0
Fork 0
refactor/models
Matthew 2019-10-30 16:23:37 -04:00
parent 43b787abc0
commit 45ec2d7af1
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 2 additions and 2 deletions

View File

@ -18,9 +18,9 @@ export default class DeleteAccount extends Command {
try { try {
if (!args[1]) return this.client.commands.get('help').run(message, [this.name]); if (!args[1]) return this.client.commands.get('help').run(message, [this.name]);
const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0] }, { emailAddress: args[0] }] }); const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0] }, { emailAddress: args[0] }] });
if (!account) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not found***`); if (!account) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not found.***`);
const { root, username, userID, emailAddress } = account; const { root, username, userID, emailAddress } = account;
if (root) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Permission denied***`); if (root) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Permission denied.***`);
const pad = (number: number, amount: number): string => '0'.repeat(amount - number.toString().length) + number; const pad = (number: number, amount: number): string => '0'.repeat(amount - number.toString().length) + number;
const randomNumber = Math.floor(Math.random() * 9999); const randomNumber = Math.floor(Math.random() * 9999);