-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.js
26 lines (21 loc) · 784 Bytes
/
bot.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
const Discord = require("discord.js");
const client = new Discord.Client();
const cron = require('cron');
client.on('ready', () => {
console.log('I am ready!');
});
client.on('message', (message) => {
if (message.content === 'ping') {
// Send "pong" to the same channel
message.channel.send('pong');
}
}); // You don't need to add anything to the message event listener
let scheduledMessage = new cron.CronJob('0 19 * * 0', () => {
// This runs every day at 10:30:00, you can do anything you want
let channel = yourGuild.channels.get('id');
channel.send('@Developer denkt an das DailyScrum!');
});
// When you want to start it, use:
scheduledMessage.start()
// You could also make a command to pause and resume the job
client.login(process.env.BOT_TOKEN);