Error handler
parent
3156fe58e9
commit
5a3520aa4b
|
@ -16,6 +16,7 @@ export default class Whois_User extends Command {
|
|||
}
|
||||
|
||||
public async run(message: Message, args: string[]) {
|
||||
try {
|
||||
let account: AccountInterface;
|
||||
if (!args[0]) account = await this.client.db.Account.findOne({ userID: message.author.id });
|
||||
else account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0] }] });
|
||||
|
@ -45,5 +46,8 @@ export default class Whois_User extends Command {
|
|||
embed.setTimestamp();
|
||||
// @ts-ignore
|
||||
message.channel.createMessage({ embed });
|
||||
} catch (error) {
|
||||
this.client.util.handleError(error, message, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue