-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
59 lines (41 loc) · 1.53 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const { Client, Message, MessageEmbed, Collection } = require('discord.js')
const fs = require('fs')
const client = new Client({
partials: ["MESSAGE", "CHANNEL", "REACTION"],
intents: 32767,
});
module.exports = client;
const dotenv = require('dotenv')
const envFile = dotenv.config()
const config = require('./config.json')
const prefix = config.prefix
const token = process.env['token']
client.on("ready", () => {
console.log(`${client.user.tag} is ready!`)
const actvs = [
`${prefix}help | Under Development`,
`${prefix}help | ${client.channels.cache.size} channels`,
`${prefix}help | ${client.users.cache.size} users`,
`${prefix}help | ${client.guilds.cache.size} servers`,
]
client.user.setActivity(actvs[Math.floor(Math.random() * (actvs.length - 1) + 1)], { type: 'COMPETING' });
setInterval(() => {
client.user.setActivity(actvs[Math.floor(Math.random() * (actvs.length - 1) + 1)], { type: 'COMPETING' });
}, 5000);
client.user.setStatus('idle')
});
//new collections
client.commands = new Collection();
client.aliases = new Collection();
client.events = new Collection();
client.categories = fs.readdirSync('./commands');
//load the files
['command'].forEach((handler) => {
require(`./handler/${handler}`)(client)
});
//slash commands
client.slashCommands = new Collection();
['slashCommand'].forEach((handler) => {
require(`./handler/${handler}`)(client)
});
client.login(token)