diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-05 19:18:38 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-05 19:18:38 +0100 |
commit | a25d1acd1d702287b6ca095a4079cf3f898cbe89 (patch) | |
tree | 552f6ccc15a082f9d662e7ff58bf2f954c0451e5 /bullshit.js | |
download | furrybot-discord-a25d1acd1d702287b6ca095a4079cf3f898cbe89.tar.xz |
Initial commit
Diffstat (limited to 'bullshit.js')
-rw-r--r-- | bullshit.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bullshit.js b/bullshit.js new file mode 100644 index 0000000..e2aa244 --- /dev/null +++ b/bullshit.js @@ -0,0 +1,22 @@ +const child_process = require("child_process") + +module.exports = { + bullshit: { + help: "Output some random bullshit (ported from the plan9front system)", + func: msg => { + const awk = child_process.spawn("awk", ["-f", "bullshit.awk", "bullshit"]) + let data = "" + + awk.stdout.on("data", chunk => { + data += chunk + }) + + awk.stderr.on("data", console.error) + + awk.on("close", code => { + if (code == 0) + msg.reply(data.slice(0, -2)) + }) + } + } +} |