From a263b91551eddf1d27720e456fc0bc1e384fe71e Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 27 Oct 2019 23:38:23 -0400 Subject: [PATCH] push changes to fix query in lock/unlock --- src/commands/lock.ts | 2 +- src/commands/unlock.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/lock.ts b/src/commands/lock.ts index e9b7d89..544f2e6 100644 --- a/src/commands/lock.ts +++ b/src/commands/lock.ts @@ -17,7 +17,7 @@ export default class Lock extends Command { public async run(message: Message, args: string[]) { // eslint-disable-line try { if (!args.length) return this.client.commands.get('help').run(message, [this.name]); - const account = await this.client.db.Account.findOne({ $or: [{ account: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); + const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); if (!account) return message.channel.createMessage(`***${this.client.stores.emojis.error} Cannot find user.***`); if (account.locked) return message.channel.createMessage(`***${this.client.stores.emojis.error} This account is already locked.***`); const edit = await message.channel.createMessage(`***${this.client.stores.emojis.loading} Locking account...***`); diff --git a/src/commands/unlock.ts b/src/commands/unlock.ts index 5174282..09befc9 100644 --- a/src/commands/unlock.ts +++ b/src/commands/unlock.ts @@ -15,7 +15,7 @@ export default class Unlock extends Command { public async run(message: Message, args: string[]) { // eslint-disable-line try { if (!args.length) return this.client.commands.get('help').run(message, [this.name]); - const account = await this.client.db.Account.findOne({ $or: [{ account: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); + const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); if (!account) return message.channel.createMessage(`***${this.client.stores.emojis.error} Cannot find user.***`); if (!account.locked) return message.channel.createMessage(`***${this.client.stores.emojis.error} This account is already unlocked.***`); const edit = await message.channel.createMessage(`***${this.client.stores.emojis.loading} Unlocking account...***`);