1
0
Fork 0

Don't error if user doesn't have account

refactor/models
Bsian 2019-11-18 20:42:18 +00:00
parent 4e27477061
commit 06265b653e
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 1 additions and 0 deletions

View File

@ -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);