From 028e90566228042eb5fe25983d28c6e3023fbaf5 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 6 May 2020 19:33:27 -0400 Subject: [PATCH] cache member if not cached already --- src/events/messageCreate.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index cae3794..7898561 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -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);