Begin guildUpdate logger

This commit is contained in:
Neko-Life 2021-08-05 17:03:34 +07:00
parent 7388f70bbb
commit 28347f073f
2 changed files with 17 additions and 0 deletions

View file

@ -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) => {

View file

@ -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);
}