-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (33 loc) · 1.04 KB
/
index.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
35
36
37
38
39
40
const fs = require("node:fs");
const path = require("node:path");
const { Client, Message } = require("revolt.js");
const { token } = require("./config.json");
const { daily } = require("./daily");
// const { quote } = require("./quote");
const client = new Client();
const message = new Message();
client.on("ready", async () => {
console.info(`Logged in as ${client.user.username}! Current time: ${Date()}`);
});
client.on("logout", () =>
console.log(`Client disconnected at ${new Date().toISOString()}`)
);
async function greeting() {
var date = new Date();
if (date.getHours() === 23 && date.getMinutes() === 00) {
client.channels
.get("01HM6DKFX0W1D1MYR06RD1D69A")
.sendMessage(`${await daily()}`);
console.info(`Daily greeting sent! Post time: ${Date()}`);
}
}
setInterval(greeting, 60000);
/*async function pinger() {
client.channels
.get("01HNXT95HQFJVD9KHDVM6K854N")
.sendMessage(`${await quote()}`);
console.info(`Ping sent! Post time: ${Date()}`);
}
setInterval(pinger, 1800000);
*/
client.loginBot(token);