Fix webhook func
This commit is contained in:
@@ -395,22 +395,22 @@ function getClientFromSyncerId(syncerId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
async function triggerWebHook(webHookURL, messageString) {
|
function triggerWebHook(messageString, serverId = getServerId(), type = VRR_DISCORD_WEBHOOK_LOG) {
|
||||||
return new Promise(resolve => {
|
let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL;
|
||||||
let tempURL = getGlobalConfig().discord.webhook.baseURL;
|
tempURL = tempURL.replace("{0}", encodeURI(messageString));
|
||||||
tempURL = tempURL.replace("{0}", messageString);
|
tempURL = tempURL.replace("{1}", serverId);
|
||||||
tempURL = tempURL.replace("{1}", webHookURL);
|
tempURL = tempURL.replace("{2}", type);
|
||||||
|
tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);
|
||||||
|
|
||||||
httpGet(
|
httpGet(
|
||||||
tempURL,
|
tempURL,
|
||||||
"",
|
"",
|
||||||
function(data) {
|
function(data) {
|
||||||
//console.warn(JSON.parse(data));
|
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user