From 06265b653e0819a311040c7e22ae5df54e7c6819 Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 18 Nov 2019 20:42:18 +0000 Subject: [PATCH] Don't error if user doesn't have account --- src/commands/bearer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/bearer.ts b/src/commands/bearer.ts index 08500d4..fd0d70a 100644 --- a/src/commands/bearer.ts +++ b/src/commands/bearer.ts @@ -16,6 +16,7 @@ export default class Bearer extends Command { public async run(message: Message) { try { const account = await this.client.db.Account.findOne({ userID: message.author.id }); + if (!account) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not found***`); // eslint-disable-next-line no-underscore-dangle const bearer = await this.client.server.security.createBearer(account._id); const dm = await this.client.getDMChannel(message.author.id);