diff --git a/index.d.ts b/index.d.ts index da54951a5..65db25e97 100644 --- a/index.d.ts +++ b/index.d.ts @@ -327,6 +327,9 @@ declare namespace Eris { MEMBER_BAN_REMOVE: 23; MEMBER_UPDATE: 24; MEMBER_ROLE_UPDATE: 25; + MEMBER_MOVE: 26; + MEMBER_DISCONNECT: 27; + BOT_ADD: 28; ROLE_CREATE: 30; ROLE_UPDATE: 31; @@ -345,6 +348,13 @@ declare namespace Eris { EMOJI_DELETE: 62; MESSAGE_DELETE: 72; + MESSAGE_BULK_DELETE: 73; + MESSAGE_PIN: 74; + MESSAGE_UNPIN: 75; + + INTEGRATION_CREATE: 80; + INTEGRATION_UPDATE: 81; + INTEGRATION_DELETE: 82; }; } diff --git a/lib/Constants.js b/lib/Constants.js index be4a6d79c..fd2c6b288 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -137,6 +137,9 @@ module.exports.AuditLogActions = { MEMBER_BAN_REMOVE: 23, MEMBER_UPDATE: 24, MEMBER_ROLE_UPDATE: 25, + MEMBER_MOVE: 26, + MEMBER_DISCONNECT: 27, + BOT_ADD: 28, ROLE_CREATE: 30, ROLE_UPDATE: 31, @@ -154,7 +157,14 @@ module.exports.AuditLogActions = { EMOJI_UPDATE: 61, EMOJI_DELETE: 62, - MESSAGE_DELETE: 72 + MESSAGE_DELETE: 72, + MESSAGE_BULK_DELETE: 73, + MESSAGE_PIN: 74, + MESSAGE_UNPIN: 75, + + INTEGRATION_CREATE: 80, + INTEGRATION_UPDATE: 81, + INTEGRATION_DELETE: 82 }; module.exports.MessageFlags = { diff --git a/lib/structures/GuildAuditLogEntry.js b/lib/structures/GuildAuditLogEntry.js index 50c7017fa..c530380a9 100644 --- a/lib/structures/GuildAuditLogEntry.js +++ b/lib/structures/GuildAuditLogEntry.js @@ -2,6 +2,7 @@ const Base = require("./Base"); const Invite = require("./Invite"); +const Constants = require("../Constants"); /** * Represents a guild audit log entry describing a moderation action @@ -90,6 +91,9 @@ class GuildAuditLogEntry extends Base { } else if(this.actionType < 20) { // Channel return this.guild && this.guild.channels.get(this.targetID); } else if(this.actionType < 30) { // Member + if(this.actionType === Constants.AuditLogActions.MEMBER_MOVE || this.actionType === Constants.AuditLogActions.MEMBER_DISCONNECT) { // MEMBER_MOVE / MEMBER_DISCONNECT + return null; + } return this.guild && this.guild.members.get(this.targetID); } else if(this.actionType < 40) { // Role return this.guild && this.guild.roles.get(this.targetID); @@ -110,6 +114,8 @@ class GuildAuditLogEntry extends Base { return this.guild && this.guild.emojis.find((emoji) => emoji.id === this.targetID); } else if(this.actionType < 80) { // Message return this.guild && this.guild.shard.client.users.get(this.targetID); + } else if(this.actionType < 90) { // Integrations + return null; } else { throw new Error("Unrecognized action type: " + this.actionType); }