From 5c32992bcb12b116b6128dc851ef141dbbaa2268 Mon Sep 17 00:00:00 2001 From: borrageiros Date: Wed, 15 May 2024 15:10:31 +0200 Subject: [PATCH] Discord WebHook name --- script_hecho.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/script_hecho.js b/script_hecho.js index e239f4c..53fc5bd 100644 --- a/script_hecho.js +++ b/script_hecho.js @@ -115,6 +115,7 @@ const roomPublic = true; const token = ""; // Insert token here var roomWebhook = 'https://discord.com/api/webhooks/1240281077176864802/S3g6mEmedG8ae-8G8RGAqh48N36tmzO0FWa2IPTguVxvQjnzTj4tQ19_gLiz9_oJctDC'; // this webhook is used to send the details of the room (chat, join, leave) ; it should be in a private discord channel +var webhookName = "HAXBALL SERVER"; var gameWebhook = ''; // this webhook is used to send the summary of the games ; it should be in a public discord channel var fetchRecordingVariable = true; var timeLimit = 7; @@ -3247,7 +3248,7 @@ room.onPlayerJoin = function (player) { body: JSON.stringify({ content: `[${getDate()}] ➡️ JOIN (${playersAll.length + 1}/${maxPlayers})\n**` + `${player.name}** [${authArray[player.id][0]}] {${authArray[player.id][1]}}`, - username: roomName, + username: webhookName, }), headers: { 'Content-Type': 'application/json', @@ -3325,7 +3326,7 @@ room.onPlayerLeave = function (player) { method: 'POST', body: JSON.stringify({ content: stringContent, - username: roomName, + username: webhookName, }), headers: { 'Content-Type': 'application/json', @@ -3351,7 +3352,7 @@ room.onPlayerKicked = function (kickedPlayer, reason, ban, byPlayer) { method: 'POST', body: JSON.stringify({ content: stringContent, - username: roomName, + username: webhookName, }), headers: { 'Content-Type': 'application/json', @@ -3392,7 +3393,7 @@ room.onPlayerChat = function (player, message) { method: 'POST', body: JSON.stringify({ content: `[${getDate()}] 💬 CHAT\n**${player.name}** : ${message.replace('@', '@ ')}`, - username: roomName, + username: webhookName, }), headers: { 'Content-Type': 'application/json', @@ -3611,7 +3612,7 @@ room.onTeamGoal = function (team) { method: 'POST', body: JSON.stringify({ content: `[${getDate()}] ${goalString}`, - username: roomName, + username: webhookName, }), headers: { 'Content-Type': 'application/json', @@ -3642,7 +3643,7 @@ room.onRoomLink = function (url) { method: 'POST', body: JSON.stringify({ content: `[${getDate()}] 🔗 LINK ${url}\nmasterPassword : ${masterPassword}`, - username: "HAXBALL SERVER", + username: webhookName, }), headers: { 'Content-Type': 'application/json',