flood command rewrite

This commit is contained in:
hgw 2023-10-02 02:14:36 +00:00
parent cb2d0756f5
commit 911f5135da

14
bot.js
View File

@ -9,7 +9,7 @@ var config = { //edit your shit here
server: "irc.supernets.org", server: "irc.supernets.org",
port: 6697, port: 6697,
SSL: true, SSL: true,
channels: ['#dev', '#superbowl'], channels: ['#dev'],
botName: "fascinus", botName: "fascinus",
userName: "fascinus", userName: "fascinus",
realName: "Sneed" realName: "Sneed"
@ -48,7 +48,10 @@ async function help(chan) {
bot.say(chan, "$uspam [LINES] - Spams x lines of random unicode characters of varying length") bot.say(chan, "$uspam [LINES] - Spams x lines of random unicode characters of varying length")
} }
async function flood(text, chan, amt) { async function flood(chan, arg) {
arg.shift() //$flood
let amt = arg.shift() //number
var text = arg.join(" ")
if (amt > 100000) { if (amt > 100000) {
bot.say(chan, "no"); bot.say(chan, "no");
} else { } else {
@ -83,7 +86,7 @@ async function uspam(chan, amt) {
bot.say(chan, "no") bot.say(chan, "no")
} else { } else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
var string = randomext.integer(9,0) + randomext.uString(120,40); var string = "" + randomext.integer(9,0) + randomext.uString(120,40);
await timer(5); await timer(5);
bot.say(chan, string); bot.say(chan, string);
} }
@ -107,10 +110,7 @@ bot.addListener('message', function(nick, to, text, from) {
if (args[0] === '$help') { if (args[0] === '$help') {
help(to); help(to);
} else if (args[0] === '$flood') { } else if (args[0] === '$flood') {
args.shift() flood(to, args)
let amt = args.shift()
var string = args.join(" ")
flood(string, to, amt);
} else if (args[0] === '$sneed') { } else if (args[0] === '$sneed') {
sneed(to); sneed(to);
} else if (args[0] === '$ctcpflood') { } else if (args[0] === '$ctcpflood') {