add command

This commit is contained in:
hgw 2023-10-02 02:14:36 +00:00
parent ad39cf8566
commit c978da3825
3 changed files with 1423 additions and 3 deletions

25
bot.js
View File

@ -3,7 +3,7 @@ var fs = require("fs");
var readline = require('readline'); var readline = require('readline');
var path = require('path'); var path = require('path');
var randomext = require('./random'); var randomext = require('./random');
const { nextTick } = require("process"); var randomWords = require('better-random-words');
var config = { //edit your shit here var config = { //edit your shit here
server: "irc.supernets.org", server: "irc.supernets.org",
@ -88,7 +88,7 @@ async function uspam(chan, amt) {
} else { } else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
var string = "" + randomext.integer(9,0) + "," + randomext.integer(9,0) + randomext.uString(120,60); var string = "" + randomext.integer(9,0) + "," + randomext.integer(9,0) + randomext.uString(120,60);
await timer(10); await timer(2);
bot.say(chan, string); bot.say(chan, string);
} }
} }
@ -100,7 +100,7 @@ async function rspam(chan, amt) {
} else { } else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
var string = generateRandomString(70); var string = generateRandomString(70);
await timer(5); await timer(2);
bot.say(chan, string); bot.say(chan, string);
} }
} }
@ -145,6 +145,23 @@ async function art(chan, url) {
}); });
} }
async function godwords(chan, amt) {
if (amt > 100000) {
bot.say(chan, "no")
} else {
text = [];
if (amt === undefined) {
var amt = 50
}
for(var i=0; i < amt; i++){
var word = randomWords({ exactly: 1 });
text.push(word);
var string = text.join(" ")
}
bot.say(chan, string);
}
}
bot.addListener('message', function(nick, to, text, from) { bot.addListener('message', function(nick, to, text, from) {
var args = text.split(' '); var args = text.split(' ');
@ -162,6 +179,8 @@ bot.addListener('message', function(nick, to, text, from) {
uspam(to, args[1]); uspam(to, args[1]);
} else if (args[0] === '$art') { } else if (args[0] === '$art') {
art(to, args[1]); art(to, args[1]);
} else if (args[0] === '$godwords') {
godwords(to, args[1]);
} }
}); });

1400
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"better-random-words": "^1.0.0",
"fs": "^0.0.1-security", "fs": "^0.0.1-security",
"irc": "^0.5.2" "irc": "^0.5.2"
}, },