diff --git a/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts b/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts index 92e50bd5..80b71bb2 100644 --- a/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts +++ b/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts @@ -1,5 +1,7 @@ import { eventListener } from "knub"; import { ModActionsPluginType } from "../types"; +import { LogsPlugin } from "../../Logs/LogsPlugin"; +import { LogType } from "../../../data/LogType"; /** * Show an alert if a member with prior notes joins the server @@ -18,6 +20,13 @@ export const PostAlertOnMemberJoinEvt = eventListener()( if (actions.length) { const alertChannel: any = pluginData.guild.channels.get(alertChannelId); + if (!alertChannel) { + pluginData.getPlugin(LogsPlugin).log(LogType.BOT_ALERT, { + body: `Unknown \`alert_channel\` configured for \`mod_actions\`: \`${alertChannelId}\``, + }); + return; + } + alertChannel.send( `<@!${member.id}> (${member.user.username}#${member.user.discriminator} \`${member.id}\`) joined with ${actions.length} prior record(s)`, );