updated port and added password

This commit is contained in:
liyunze 2026-10-14 14:58:26 +08:00
parent 40f3da80f6
commit 2c4d65e907
2 changed files with 21 additions and 12 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,13 +1,20 @@
// STREAMER.BOT SETTINGS // STREAMER.BOT SETTINGS
const client = new StreamerbotClient({ let client;
try {
client = new StreamerbotClient({
host: configs.streamerBotSettings.host, host: configs.streamerBotSettings.host,
port: configs.streamerBotSettings.port, port: configs.streamerBotSettings.port,
endpoint: configs.streamerBotSettings.endpoint, endpoint: configs.streamerBotSettings.endpoint,
onConnect: onConnect, password: configs.streamerBotSettings.password ?? "",
onDisconnect: onDisconnect, onConnect,
onError: onError, onDisconnect,
onError,
}); });
} catch (err) {
onError(err);
}
client.on("General.Custom", (data) => onCustom(data)); client.on("General.Custom", (data) => onCustom(data));
if (configs.userColorSettings.autoUserColor) { if (configs.userColorSettings.autoUserColor) {
@ -56,6 +63,8 @@ function onDisconnect() {
} }
function onError(err) { function onError(err) {
console.error("Streamer.bot connection error:", err);
showConnectionError( showConnectionError(
"Connection Failed: " + (err?.message || "Unknown error"), "Connection Failed: " + (err?.message || "Unknown error"),
); );