-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.ts
33 lines (26 loc) · 765 Bytes
/
mod.ts
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
import { CommandClient, Intents } from './deps.ts';
import { config } from './config.ts';
const client = new CommandClient({
prefix: '%',
owners: config.owners,
});
client.once('ready', async () => {
console.log(`${client.user?.username} is ready!`);
client.setPresence({
name: 'notifications',
type: 'LISTENING',
});
const headers = new Headers({
accept: "application/json",
});
headers.append('Title', 'Bot Status');
headers.append('Tags', `gear`);
headers.append('Priority', 'low');
await fetch(`https://${config.ntfyServer}/bot-status`, {
method: 'POST',
body: `ntfy-bot is back online!`,
headers: headers,
});
});
client.commands.loader.loadDirectory('./commands', { maxDepth: 2 });
client.connect(config.token, Intents.All);