You could add an array to your guildConfig mongodb model called something like enabledEvents and add events to it.
Then to check if an event is enabled you just check if an element (the event) is inside that array.
enabledEvents = ["guildMemberAdd", "guildBanAdd"];
if (enabledEvents.includes("guildMemberAdd")) {
// do stuff
};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…