aboutsummaryrefslogtreecommitdiff
path: root/bullshit.js
blob: e2aa24475c1163738229b8d71fba1e96db27e8eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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))
			})
		}
	}
}