diff --git a/src/local_events.js b/src/local_events.js index 28838e9..7b0c486 100644 --- a/src/local_events.js +++ b/src/local_events.js @@ -1,24 +1,24 @@ -dClient.on("guildMemberAdd", function(member){ +dClient.on("guildMemberAdd", async function(member){ if (member.guild.id == config.guildID) this.emit("local_guildMemberAdd", member); }); -dClient.on("guildMemberRemove", function(member){ +dClient.on("guildMemberRemove", async function(member){ if (member.guild.id == config.guildID) this.emit("local_guildMemberRemove", member); }); -dClient.on("guildMemberUpdate", function(oldMember, newMember){ +dClient.on("guildMemberUpdate", async function(oldMember, newMember){ if (newMember.guild.id == config.guildID) this.emit("local_guildMemberUpdate", oldMember, newMember); }); -dClient.on("message", function(message){ - if (message.guild.id == config.guildID) +dClient.on("message", async function(message){ + if (message.guild && message.guild.id == config.guildID) this.emit("local_message", message); }); -dClient.on("presenceUpdate", function(oldPresence, newPresence){ +dClient.on("presenceUpdate", async function(oldPresence, newPresence){ if (newPresence.member && newPresence.member.guild.id == config.guildID) this.emit("local_presenceUpdate", oldPresence, newPresence); }); -dClient.on("voiceStateUpdate", function(oldState, newState){ +dClient.on("voiceStateUpdate", async function(oldState, newState){ if (newState.guild.id == config.guildID) this.emit("local_voiceStateUpdate", oldState, newState); -}); \ No newline at end of file +});