diff --git a/src/commands/addreferral.ts b/src/commands/addreferral.ts index ef7a057..2fecf84 100644 --- a/src/commands/addreferral.ts +++ b/src/commands/addreferral.ts @@ -15,7 +15,7 @@ export default class AddReferral 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: [{ username: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); + const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { referralCode: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] }); if (!account) return this.error(message.channel, 'Cannot find user.'); await account.updateOne({ $inc: { totalReferrals: 1 } });