diff --git a/scripts/server/discord.js b/scripts/server/discord.js index 5457f467..39f1877c 100644 --- a/scripts/server/discord.js +++ b/scripts/server/discord.js @@ -93,6 +93,10 @@ function messageDiscordChatChannel(messageString) { return false; } + if(!getGlobalConfig().discord.sendChat) { + return false; + } + if(!getServerConfig().discord.sendChat) { return false; } @@ -108,6 +112,10 @@ function messageDiscordEventChannel(messageString) { return false; } + if(!getGlobalConfig().discord.sendEvents) { + return false; + } + if(!getServerConfig().discord.sendEvents) { return false; } @@ -123,6 +131,10 @@ function messageDiscordAdminChannel(messageString) { return false; } + if(!getGlobalConfig().discord.sendAdmin) { + return false; + } + if(!getServerConfig().discord.sendAdmin) { return false; } diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index 28a0ae85..3ed39bb4 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -408,6 +408,10 @@ function getClientFromSyncerId(syncerId) { // =========================================================================== function triggerWebHook(messageString, serverId = getServerId(), type = VRR_DISCORD_WEBHOOK_LOG) { + if(!getGlobalConfig().discord.webhook.enabled) { + return false; + } + let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL; tempURL = tempURL.replace("{0}", encodeURI(messageString)); tempURL = tempURL.replace("{1}", serverId);