max flood limit

This commit is contained in:
hgw 2023-10-02 02:14:35 +00:00
parent d5b4027931
commit 96b361ce07

20
bot.js
View File

@ -48,11 +48,15 @@ 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, times) { async function flood(text, chan, amt) {
for(var i=0; i < times; i++){ if (amt > '100000') {
bot.say(chan, "no");
} else {
for(var i=0; i < amt; i++){
bot.say(chan, text); bot.say(chan, text);
} }
} }
}
async function sneed(chan) { async function sneed(chan) {
bot.say(chan, 'THE SIGN IS A SUBTLE JOKE. THE SHOP IS CALLED \"SNEED\'S FEED & SEED\", WHERE') bot.say(chan, 'THE SIGN IS A SUBTLE JOKE. THE SHOP IS CALLED \"SNEED\'S FEED & SEED\", WHERE')
@ -64,23 +68,35 @@ async function sneed(chan) {
} }
async function ctcp(target, text, amt) { async function ctcp(target, text, amt) {
if (amt > '100000') {
bot.say(chan, "no");
} else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
bot.ctcp(target, "privmsg", text); bot.ctcp(target, "privmsg", text);
await timer(1000); await timer(1000);
} }
} }
}
async function rspam(chan, amt) { async function rspam(chan, amt) {
if (amt > '100000') {
bot.say(chan, "no")
} else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
bot.say(chan, generateRandomString(randomext.integer(100,60))); bot.say(chan, generateRandomString(randomext.integer(100,60)));
} }
} }
}
async function uspam(chan, amt){ async function uspam(chan, amt){
if (amt > '100000') {
bot.say(chan, "no")
} else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
bot.say(chan, "0" + randomext.integer(9,0) + randomext.uString(120,40)); bot.say(chan, "0" + randomext.integer(9,0) + randomext.uString(120,40));
} }
} }
}
bot.addListener('message', function(nick, to, text, from) { bot.addListener('message', function(nick, to, text, from) {
var args = text.split(' '); var args = text.split(' ');