diff --git a/scripts/server/discord.js b/scripts/server/discord.js index ce0a1566..7e7d6a7f 100644 --- a/scripts/server/discord.js +++ b/scripts/server/discord.js @@ -155,6 +155,29 @@ function messageDiscordAdminChannel(messageString) { // =========================================================================== +function messageDiscordClanWebhook(clanIndex, requiredFlagValue, messageString) { + if (getServerConfig().devServer == true) { + return false; + } + + if (!getGlobalConfig().discord.sendClan) { + return false; + } + + if (!getServerConfig().discord.sendClan) { + return false; + } + + if (!hasBitFlag(getClanData(clanIndex).discordWebhookFlags, requiredFlagValue)) { + return false; + } + + messageString = removeColoursInMessage(messageString); + triggerClanDiscordWebHook(clanIndex, messageString); +} + +// =========================================================================== + function triggerDiscordWebHook(messageString, serverId = getServerId(), type = AGRP_DISCORD_WEBHOOK_LOG) { if (!getGlobalConfig().discord.webhook.enabled) { return false; @@ -177,4 +200,32 @@ function triggerDiscordWebHook(messageString, serverId = getServerId(), type = A ); } +// =========================================================================== + +function triggerClanDiscordWebHook(clanIndex, messageString) { + if (!getGlobalConfig().discord.webhook.enabled) { + return false; + } + + /* + let webhookURL = getClanData(clanIndex).discordWebhookURL; + + let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL; + tempURL = tempURL.replace("{0}", encodeURI(messageString)); + tempURL = tempURL.replace("{1}", serverId); + tempURL = tempURL.replace("{2}", type); + tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass); + + httpGet( + tempURL, + "", + function (data) { + + }, + function (data) { + } + ); + */ +} + // =========================================================================== \ No newline at end of file diff --git a/scripts/server/staff.js b/scripts/server/staff.js index b96f2336..b3542b94 100644 --- a/scripts/server/staff.js +++ b/scripts/server/staff.js @@ -1139,8 +1139,7 @@ function getStaffFlagsCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - let flagName = getParam(params, " ", 2) || "None"; + let targetClient = getParam(params, " ", 1); if (!targetClient) { messagePlayerError(client, getLocaleString(client, "InvalidPlayer"));