Added warning if application disocrd webhook is not defined
All checks were successful
Continuous Integration / Update Development (push) Successful in 2m24s
All checks were successful
Continuous Integration / Update Development (push) Successful in 2m24s
This commit is contained in:
@@ -1,7 +1,14 @@
|
|||||||
import { bus } from "../events/eventBus";
|
import { bus } from "../events/eventBus";
|
||||||
|
import { logger } from "../logging/logger";
|
||||||
|
|
||||||
export function initializeDiscordIntegrations() {
|
export function initializeDiscordIntegrations() {
|
||||||
bus.on('application.create', async (event) => {
|
bus.on('application.create', async (event) => {
|
||||||
|
|
||||||
|
if (!process.env.DISCORD_APPLICATIONS_WEBHOOK) {
|
||||||
|
logger.error("app", 'Discord Applications Webhook is not defined')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let applicantName = event.payload.member_discord_id || event.payload.member_name;
|
let applicantName = event.payload.member_discord_id || event.payload.member_name;
|
||||||
if (event.payload.member_discord_id) {
|
if (event.payload.member_discord_id) {
|
||||||
applicantName = `<@${event.payload.member_discord_id}>`;
|
applicantName = `<@${event.payload.member_discord_id}>`;
|
||||||
|
|||||||
Reference in New Issue
Block a user