flood multi-word handling

This commit is contained in:
hgw 2023-10-02 02:14:35 +00:00
parent a4b7c5a7ec
commit d1433609c9
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ cold hard bot for cold hard chats
## Commands
- $flood [TEXT] [AMOUNT] - Floods the channel with a specific line x amount of times
- $flood [AMOUNT] [TEXT] - Floods the channel with a specific line x amount of times
- $ctcpflood [TARGET] [TEXT (one word)] [AMOUNT] - Sends x amount of CTCP requests to a target.
- $sneed - Pastes the Sneed's Feed and Seed copypasta.
- $rspam [LINES] - Spams x lines of random characters

7
bot.js
View File

@ -41,7 +41,7 @@ const generateRandomString = (amt) => {
async function help(chan) {
bot.say(chan, 'Fascinus - https://git.supernets.org/hogwart7/fascinus')
bot.say(chan, "$flood [TEXT] [AMOUNT] - Floods the channel with a specific line x amount of times")
bot.say(chan, "$flood [AMOUNT] [TEXT] - Floods the channel with a specific line x amount of times")
bot.say(chan, "$ctcpflood [TARGET] [TEXT (one word)] [AMOUNT] - Sends x amount of CTCP requests to a target.")
bot.say(chan, "$sneed - Pastes the Sneed's Feed and Seed copypasta.")
bot.say(chan, "$rspam [LINES] - Spams x lines of random characters")
@ -99,7 +99,10 @@ bot.addListener('message', function(nick, to, text, from) {
if (args[0] === '$help') {
help(to);
} else if (args[0] === '$flood') {
flood(args[1], to, args[2]);
args.shift()
let amt = args.shift()
var string = args.join(" ")
flood(string, to, amt);
} else if (args[0] === '$sneed') {
sneed(to);
} else if (args[0] === '$ctcpflood') {