Check for discord webhook global config override
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user