Compare commits

..

No commits in common. "be8377c32913b25aba01948601969342d32b24c8" and "e5a8baaa812e027888ac5a26f2bb5d896e857486" have entirely different histories.

4 changed files with 11 additions and 26 deletions

8
bot.js
View File

@ -81,11 +81,7 @@ async function godwords(chan, amt) {
}
async function phish(chan, height, width) {
openPostWorker(chan, 'phish', height, width, "em")
}
async function symphish(chan, height, width) {
openPostWorker(chan, 'phish', height, width, "sym")
openPostWorker(chan, 'phish', height, width)
}
bot.addListener('message', function(nick, to, text, from) {
@ -121,8 +117,6 @@ bot.addListener('message', function(nick, to, text, from) {
godwords(to, args[1]);
} else if (command === config.irc.prefix+'phish') {
phish(to, args[1], args[2])
} else if (command === config.irc.prefix+'symphish') {
symphish(to, args[1], args[2])
}
msgTimeout.add(to);
setTimeout(() => {

View File

@ -1,9 +1,8 @@
const config = require('../config/config.json')
const { parentPort, workerData } = require('worker_threads');
const { d1, d2, d3 } = workerData;
const { d1, d2 } = workerData;
var height = d1
var width = d2
var type = d3
var phish = require('phishies');
const timer = ms => new Promise(res => setTimeout(res, ms))
@ -34,17 +33,6 @@ async function sendUpstream(content) {
process.exit()
}
function gen(height, width, type) {
consoleLog('[phish] Generating phish output')
if (type == "em") {
var aquarium = phish.aquarium(height, width)
} else if (type == "sym") {
var aquarium = phish.aquarium_sym(height, width)
}
var output = aquarium.join("\n")
sendUpstream(output)
}
if (height > 100) {
consoleLog('[phish] Height requesteed was over the maximum allowable amount, defaulting to maximum')
height = 100
@ -61,4 +49,7 @@ if (width == undefined) {
consoleLog('[phish] Width was not specified, defaulting to 5')
width = 7
}
gen(height, width, type)
consoleLog('[phish] Generating phish output')
var aquarium = phish.aquarium(height, width)
var output = aquarium.join("\n")
sendUpstream(output)

6
package-lock.json generated
View File

@ -49,9 +49,9 @@
}
},
"phishies": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/phishies/-/phishies-1.2.0.tgz",
"integrity": "sha512-1Z4Mt3es3NEkEFyYyOnVAyiDeGghh40IrAQ10lcUQbmNkoI3ZfaHomCDffir4w9x6XVjHCl21doUjCokBMry5Q=="
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/phishies/-/phishies-1.0.2.tgz",
"integrity": "sha512-uZArCHgYfx7GfpPGUJiQL+eh+6ksj5KGz5n9gJMjbfdk5KJEh+UZGNe4qTgmZGqeFR9NVAaL18+cebsfE7D02g=="
}
}
}

View File

@ -6,7 +6,7 @@
"dependencies": {
"fs": "^0.0.1-security",
"irc": "^0.5.2",
"phishies": "^1.2.0"
"phishies": "^1.0.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"