-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (29 loc) · 965 Bytes
/
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
// Import dependencies
const { Client } = require('discord.js');
const dotenv = require('dotenv');
const keepAlive = require('./server');
const Monitor = require('ping-monitor');
// Load environment variables
dotenv.config();
const { loadAll, options } = require('./utils/loader');
// Create Discord client
const client = new Client(options);
loadAll(client);
// hosting bot
keepAlive();
const monitor = new Monitor({
website:'',
title:'DKB',
interval:2,
});
monitor.on('up', res => console.log(`${res.website} alive`));
monitor.on('down', res => console.log(`${res.website} ded ded as hell`));
monitor.on('stop', website => console.log(`${website} went bruh`));
monitor.on('error', () => console.log(`error`));
// Import and configure modules
const { InitPlayer } = require('./player');
InitPlayer(client);
// Log in the client
const discordToken = process.env['token'] || require('./config.json').token;
client.login(discordToken);
// Main execution code