Skip to content

Commit

Permalink
no longer writing to member gateway, no use in guildMemberJoin
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusgerdin committed Jun 25, 2020
1 parent 4e8d356 commit e4120bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/events/guildMemberAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ module.exports = class extends Event {
async run(member) {
if (!member.guild) return;

const modHistory = await this.client.settings.get('moderation.cases').filter(modCase => modCase.user === member.id && modCase.guild === member.guild.id);
for (const modCase of modHistory) {
if (!member.settings.get('moderation.cases').includes(modCase.id)) {
await member.settings.sync();
await member.settings.update('moderation.cases', modCase.id, member.guild);
}
}

if (member.guild.settings.get('channels.log') && member.guild.settings.get('logs.events.guildMemberAdd') && !member.user.bot) await this.serverLog(member);

if (member.guild.settings.get('greetings.welcomeNewUsers')) this.client.emit('guildMemberWelcome', member);
Expand Down
6 changes: 0 additions & 6 deletions src/lib/structures/ModCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,15 @@ module.exports = class Case {
this.id = await this._getID();
this.submitted = true;

const member = this.guild.members.get(this.user.id);

await this.client.settings.update('moderation.cases', await this.pack(), this.guild);
if (member && member.id !== this.client.user.id) await member.settings.update('moderation.cases', this.id, this.guild);

return this;
}

async delete() {
if (!this.submitted) throw 'Cases cannot be deleted unless submitted first!';

const member = this.guild.members.get(this.user);

await this.client.settings.destroy('moderation.cases', this, this.guild);
await member.settings.destroy('moderation.cases', this.id, this.guild);

return this;
}
Expand Down

0 comments on commit e4120bf

Please sign in to comment.