Feature/103 improve events (#201)

* Improve event handler to only run events that have been registered

* Tidy up events into their own function files
This commit is contained in:
Vylpes 2022-10-09 15:23:25 +01:00 committed by GitHub
parent ed8f5927c8
commit 0d63bd120d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 361 additions and 379 deletions

View file

@ -0,0 +1,14 @@
import { Message } from "discord.js";
import SettingsHelper from "../../helpers/SettingsHelper";
import VerificationCheck from "./MessageCreate/VerificationCheck";
export default async function MessageCreate(message: Message) {
if (!message.guild) return;
if (message.author.bot) return;
const isVerificationEnabled = await SettingsHelper.GetSetting("verification.enabled", message.guild.id);
if (isVerificationEnabled && isVerificationEnabled.toLocaleLowerCase() == "true") {
await VerificationCheck(message);
}
}