Togglable flood commands

This commit is contained in:
hgw 2023-10-08 01:48:26 +00:00
parent 6dbc9087e1
commit 445ca1b10b
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4
2 changed files with 14 additions and 10 deletions

19
bot.js
View File

@ -105,16 +105,8 @@ bot.addListener('message', function(nick, to, text, from) {
var command = args[0].toLowerCase() var command = args[0].toLowerCase()
if (args[0] === '$help') { if (args[0] === '$help') {
help(to); help(to);
} else if (command === config.irc.prefix+'flood') {
flood(to, args)
} else if (command === config.irc.prefix+'sneed') { } else if (command === config.irc.prefix+'sneed') {
sneed(to); sneed(to);
} else if (command === config.irc.prefix+'ctcpflood') {
ctcp(args[1], args[2], args[3]);
} else if (command === config.irc.prefix+'rspam') {
rspam(to, args[1])
} else if (command === config.irc.prefix+'uspam') {
uspam(to, args[1]);
} else if (command === config.irc.prefix+'art') { } else if (command === config.irc.prefix+'art') {
art(to, args[1]); art(to, args[1]);
} else if (command === config.irc.prefix+'godwords') { } else if (command === config.irc.prefix+'godwords') {
@ -124,6 +116,17 @@ bot.addListener('message', function(nick, to, text, from) {
} else if (command === config.irc.prefix+'symphish') { } else if (command === config.irc.prefix+'symphish') {
symphish(to, args[1], args[2]) symphish(to, args[1], args[2])
} }
if (config.floodprotect.enable_flood_commands == "true") {
if (command === config.irc.prefix+'flood') {
flood(to, args)
} else if (command === config.irc.prefix+'ctcpflood') {
ctcp(args[1], args[2], args[3]);
} else if (command === config.irc.prefix+'rspam') {
rspam(to, args[1])
} else if (command === config.irc.prefix+'uspam') {
uspam(to, args[1]);
}
}
msgTimeout.add(to); msgTimeout.add(to);
setTimeout(() => { setTimeout(() => {
msgTimeout.delete(to); msgTimeout.delete(to);

View File

@ -15,7 +15,8 @@
"floodprotect": { "floodprotect": {
"flood_protection": "false", "flood_protection": "false",
"flood_protection_delay": "0", "flood_protection_delay": "0",
"command_listen_timeout": "2500" "command_listen_timeout": "2500",
"enable_flood_commands": "true"
}, },
"errorhandling": { "errorhandling": {
"error_logging": "true", "error_logging": "true",