cache member if not cached already

merge-requests/12/head
Matthew 2020-05-06 19:33:27 -04:00 committed by Bsian
parent 49d3ce608c
commit 2bf98fa923
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ export default class {
if (resolved.cmd.guildOnly && !(message.channel instanceof TextChannel || message.channel instanceof NewsChannel)) return;
if (!resolved.cmd.enabled) { message.channel.createMessage(`***${this.client.util.emojis.ERROR} This command has been disabled***`); return; }
if (!resolved.cmd.checkPermissions(message.member)) return;
this.client.util.signale.info(`User '${message.author.username}#${message.author.discriminator}' ran command '${resolved.cmd.name}' in '${message.channel.id}'.`);
if ((message.channel.type === 0) && !message.channel.guild.members.get(message.author.id)) {
message.channel.guild.members.add(await message.channel.guild.getRESTMember(message.author.id));
}
this.client.util.signale.log(`User '${message.author.username}#${message.author.discriminator}' ran command '${resolved.cmd.name}' in '${message.channel.id}'.`);
await resolved.cmd.run(message, resolved.args);
} catch (err) {
this.client.util.handleError(err, message);