-
Notifications
You must be signed in to change notification settings - Fork 4
/
ZombieWatch.js
34 lines (29 loc) · 912 Bytes
/
ZombieWatch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const channel = '489246833567203337';
const color = Math.floor(Math.random() * 0xFFFFFF);
module.exports = class ZombieWatch {
constructor(bot) {
this.bot = bot;
this.bot.on('ready', this.initialize.bind(this));
}
async initialize() {
this.send({
title: `Greetings!`,
description: `My name is **0x${this.color}**, and I will be your Zombie Watcher for this evening.`
});
this.interval = setInterval(this.report.bind(this), 1000 * 60 * 10); // every 10 minutes, adjust as needed
}
get color() {
return color.toString(16).toUpperCase();
}
async send(embed) {
embed.color = color;
await this.bot.createMessage(channel, {
embed
});
}
async report() {
await this.send({
description: `Hello! This is 0x${this.color} checking in.`
});
}
}