forked from engineering/cloudservices
Don't error if user doesn't have account
parent
4e27477061
commit
06265b653e
|
@ -16,6 +16,7 @@ export default class Bearer extends Command {
|
||||||
public async run(message: Message) {
|
public async run(message: Message) {
|
||||||
try {
|
try {
|
||||||
const account = await this.client.db.Account.findOne({ userID: message.author.id });
|
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
|
// eslint-disable-next-line no-underscore-dangle
|
||||||
const bearer = await this.client.server.security.createBearer(account._id);
|
const bearer = await this.client.server.security.createBearer(account._id);
|
||||||
const dm = await this.client.getDMChannel(message.author.id);
|
const dm = await this.client.getDMChannel(message.author.id);
|
||||||
|
|
Loading…
Reference in New Issue