]> git.lizzy.rs Git - furrybot-discord.git/blob - death.js
Add bad apple
[furrybot-discord.git] / death.js
1 const util = require("util")
2 const google_images = require("free-google-images")
3 const common = require("./common.js")
4
5 const kill_deathmessages = require("./kill_deathmessages.json")
6 const deathmessages = require("./deathmessages.json")
7
8 module.exports = {
9         kill: {
10                 func: (msg, [targetPing]) => {
11                         const user = msg.author.id
12                         const target = common.getPing(msg, targetPing, true)
13
14                         if (target)
15                                 google_images.searchRandom("kill+meme")
16                                         .then(result => msg.channel.send((target == user
17                                                 ? `<@!${target}> died due to lack of friends.`
18                                                 : util.format(common.choose(kill_deathmessages), `<@!${target}>`, `<@!${user}>`)
19                                         ) + `\n${result.image.url}`))
20                 }
21         },
22         die: {
23                 func: msg => {
24                         google_images.searchRandom("die+meme")
25                                 .then(result => msg.channel.send(util.format(common.choose(deathmessages), `<@!${msg.author.id}>`) + `\n${result.image.url}`))
26                 }
27         },
28 }