diff --git a/Main.js b/Main.js index 1850f78..ad63d29 100644 --- a/Main.js +++ b/Main.js @@ -109,6 +109,10 @@ client.on("guildBanAdd", async (GUILD, USER) => { client.on("guildBanRemove", async (GUILD, USER) => { lgr.guildBanRemove(GUILD, USER); +}); + +client.on("guildUpdate", async (oldGuild, newGuild) => { + lgr.guildUpdate(oldGuild, newGuild); }) client.on("messageDelete", async (msg) => { diff --git a/resources/eventsLogger/guildUpdate.js b/resources/eventsLogger/guildUpdate.js new file mode 100644 index 0000000..6c84440 --- /dev/null +++ b/resources/eventsLogger/guildUpdate.js @@ -0,0 +1,13 @@ +'use strict'; + +const { Guild } = require("discord.js"); + +/** + * @param {Guild} oldGuild + * @param {Guild} newGuild + */ +module.exports = async (oldGuild, newGuild) => { + if (!newGuild.DB) await newGuild.dbLoad(); + let audit = (await newGuild.fetchAuditLogs({ "limit": 1, "type": "GUILD_UPDATE" })).entries.first(); + console.log(audit); +} \ No newline at end of file