From 14ddf29ae7079b5d2f9bfe53eaff618bfe842f81 Mon Sep 17 00:00:00 2001 From: hgw Date: Mon, 2 Oct 2023 02:11:26 +0000 Subject: [PATCH] reshuffle flood protection config toggles --- bot.js | 8 ++++---- config/example.default.json | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bot.js b/bot.js index 106ec89..2532ed3 100644 --- a/bot.js +++ b/bot.js @@ -16,8 +16,8 @@ var bot = new irc.Client(config.irc.server, config.irc.nickname, { autoRejoin: config.irc.autorejoin, userName: config.irc.username, realName: config.irc.realname, - floodProtection: config.irc.floodprotection, - floodProtectionDelay: config.irc.floodprotectiondelay + floodProtection: config.floodprotect.flood_protection, + floodProtectionDelay: config.floodprotect.flood_protection_delay }); const msgTimeout = new Set(); @@ -131,7 +131,7 @@ bot.addListener('message', function(nick, to, text, from) { msgTimeoutMsg.add("yes"); setTimeout(() => { msgTimeoutMsg.delete("yes"); - }, config.misc.command_listen_timeout) + }, config.floodprotect.command_listen_timeout) } } else { var args = text.split(' '); @@ -147,7 +147,7 @@ bot.addListener('message', function(nick, to, text, from) { msgTimeout.add(to); setTimeout(() => { msgTimeout.delete(to); - }, config.misc.command_listen_timeout) + }, config.floodprotect.command_listen_timeout) } }); diff --git a/config/example.default.json b/config/example.default.json index 988154c..f93ff41 100644 --- a/config/example.default.json +++ b/config/example.default.json @@ -10,10 +10,13 @@ "username": "mercury", "realname": "git.supernets.org/hgw/mercury", "autorejoin": "true", - "floodprotection": "false", - "floodprotectiondelay": "0", "prefix": "m!" }, + "floodprotect": { + "flood_protection": "false", + "flood_protection_delay": "0", + "command_listen_timeout": "2500" + }, "errorhandling": { "error_logging": "true", "error_channel": "#CHANNELTOSENDERRORSTO", @@ -47,8 +50,7 @@ }, "misc": { "display_help_logo": "true", - "logging": "true", - "command_listen_timeout": "2500" + "logging": "true" }, "motd": { "enable": "true",