]> git.lizzy.rs Git - furrybot-discord.git/blob - badapple.js
Add bad apple
[furrybot-discord.git] / badapple.js
1 const badapple = require("./badapple.json")
2
3 module.exports = {
4         badapple: {
5                 operator: true,
6                 func: msg => msg.reply("loading...")
7                         .then(canvas => {
8                                 const frames = badapple.frames.map(frame => "```\n" + frame + "```")
9                                 
10                                 const iv = setInterval(_ => {
11                                         const frame = frames.shift()
12                                 
13                                         if (frame)
14                                                 canvas.edit(frame)
15                                         else
16                                                 clearInterval(iv)
17                                         
18                                 }, 1000 / badapple.fps)
19                         })
20         }
21 }