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,
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)
}
});

View File

@ -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",