reshuffle flood protection config toggles

This commit is contained in:
hgw 2023-10-02 02:11:26 +00:00
parent 6f77fb96cf
commit 14ddf29ae7
2 changed files with 10 additions and 8 deletions

8
bot.js
View File

@ -16,8 +16,8 @@ var bot = new irc.Client(config.irc.server, config.irc.nickname, {
autoRejoin: config.irc.autorejoin, autoRejoin: config.irc.autorejoin,
userName: config.irc.username, userName: config.irc.username,
realName: config.irc.realname, realName: config.irc.realname,
floodProtection: config.irc.floodprotection, floodProtection: config.floodprotect.flood_protection,
floodProtectionDelay: config.irc.floodprotectiondelay floodProtectionDelay: config.floodprotect.flood_protection_delay
}); });
const msgTimeout = new Set(); const msgTimeout = new Set();
@ -131,7 +131,7 @@ bot.addListener('message', function(nick, to, text, from) {
msgTimeoutMsg.add("yes"); msgTimeoutMsg.add("yes");
setTimeout(() => { setTimeout(() => {
msgTimeoutMsg.delete("yes"); msgTimeoutMsg.delete("yes");
}, config.misc.command_listen_timeout) }, config.floodprotect.command_listen_timeout)
} }
} else { } else {
var args = text.split(' '); var args = text.split(' ');
@ -147,7 +147,7 @@ bot.addListener('message', function(nick, to, text, from) {
msgTimeout.add(to); msgTimeout.add(to);
setTimeout(() => { setTimeout(() => {
msgTimeout.delete(to); msgTimeout.delete(to);
}, config.misc.command_listen_timeout) }, config.floodprotect.command_listen_timeout)
} }
}); });

View File

@ -10,10 +10,13 @@
"username": "mercury", "username": "mercury",
"realname": "git.supernets.org/hgw/mercury", "realname": "git.supernets.org/hgw/mercury",
"autorejoin": "true", "autorejoin": "true",
"floodprotection": "false",
"floodprotectiondelay": "0",
"prefix": "m!" "prefix": "m!"
}, },
"floodprotect": {
"flood_protection": "false",
"flood_protection_delay": "0",
"command_listen_timeout": "2500"
},
"errorhandling": { "errorhandling": {
"error_logging": "true", "error_logging": "true",
"error_channel": "#CHANNELTOSENDERRORSTO", "error_channel": "#CHANNELTOSENDERRORSTO",
@ -47,8 +50,7 @@
}, },
"misc": { "misc": {
"display_help_logo": "true", "display_help_logo": "true",
"logging": "true", "logging": "true"
"command_listen_timeout": "2500"
}, },
"motd": { "motd": {
"enable": "true", "enable": "true",