]> git.lizzy.rs Git - furrybot-discord.git/blob - bullshit.js
Add bad apple
[furrybot-discord.git] / bullshit.js
1 const child_process = require("child_process")
2
3 module.exports = {
4         bullshit: {
5                 help: "Output some random bullshit (ported from the plan9front system)",
6                 func: msg => {
7                         const awk = child_process.spawn("awk", ["-f", "bullshit.awk", "bullshit"])
8                         let data = ""
9
10                         awk.stdout.on("data", chunk => {
11                                 data += chunk
12                         })
13
14                         awk.stderr.on("data", console.error)
15
16                         awk.on("close", code => {
17                                 if (code == 0)
18                                         msg.reply(data.slice(0, -2))
19                         })
20                 }
21         }
22 }