1 const common = require("./common.js")
2 const sha1 = require("sha1")
3 const pseudoRandom = require("pseudo-random")
5 const german = require("./german.json")
6 const books = require("./books.json")
10 func: msg => msg.channel.send(`<@!${msg.author.id}> rolled a dice and got a ${1 + Math.floor(Math.random() * 6)}.`)
13 func: msg => msg.channel.send(`<@!${msg.author.id}> flipped a coin and got ${common.choose(["Heads", "Tails"])}.`)
16 func: (msg, options) => msg.reply(options.length < 2 ? "Not enough options" : `I choose ${common.choose(options)}.`)
19 func: msg => msg.reply(
20 new Array(1 + Math.floor(Math.random() * 10))
22 .map(_ => new Array(3)
23 .fill(common.choose(["u", "ü", "o", "ö"])[common.choose(["toUpperCase", "toLowerCase"])]())
24 .fill("w"[common.choose(["toUpperCase", "toLowerCase"])](), 1, 2)
31 func: (msg, [rawSpecies]) => {
32 const species = common.uppercase((rawSpecies + (rawSpecies.slice(-1) == "s" ? "" : "s")).toLowerCase())
33 msg.reply(`${species} are ${pseudoRandom(parseInt(sha1(species), 16) % 1e9).random() < 0.5 ? "" : "not "}extinct.`)
37 func: msg => msg.reply(common.choose(german))
40 func: msg => msg.reply(common.choose(books))
43 func: msg => msg.reply("https://youtube.com/watch?v=dQw4w9WgXcQ")