Check for discord webhook global config override

This commit is contained in:
Vortrex
2022-05-15 04:20:47 -05:00
parent 1f3680a38b
commit 47275239d0
2 changed files with 16 additions and 0 deletions

View File

@@ -93,6 +93,10 @@ function messageDiscordChatChannel(messageString) {
return false; return false;
} }
if(!getGlobalConfig().discord.sendChat) {
return false;
}
if(!getServerConfig().discord.sendChat) { if(!getServerConfig().discord.sendChat) {
return false; return false;
} }
@@ -108,6 +112,10 @@ function messageDiscordEventChannel(messageString) {
return false; return false;
} }
if(!getGlobalConfig().discord.sendEvents) {
return false;
}
if(!getServerConfig().discord.sendEvents) { if(!getServerConfig().discord.sendEvents) {
return false; return false;
} }
@@ -123,6 +131,10 @@ function messageDiscordAdminChannel(messageString) {
return false; return false;
} }
if(!getGlobalConfig().discord.sendAdmin) {
return false;
}
if(!getServerConfig().discord.sendAdmin) { if(!getServerConfig().discord.sendAdmin) {
return false; return false;
} }

View File

@@ -408,6 +408,10 @@ function getClientFromSyncerId(syncerId) {
// =========================================================================== // ===========================================================================
function triggerWebHook(messageString, serverId = getServerId(), type = VRR_DISCORD_WEBHOOK_LOG) { function triggerWebHook(messageString, serverId = getServerId(), type = VRR_DISCORD_WEBHOOK_LOG) {
if(!getGlobalConfig().discord.webhook.enabled) {
return false;
}
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL; let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
tempURL = tempURL.replace("{0}", encodeURI(messageString)); tempURL = tempURL.replace("{0}", encodeURI(messageString));
tempURL = tempURL.replace("{1}", serverId); tempURL = tempURL.replace("{1}", serverId);