-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
66 lines (55 loc) · 1.62 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
60
61
62
63
64
65
66
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 config = require("./config.json");
const prefix = config.prefix;
const token = config.token;
client.on("ready", () => {
console.log(`${client.user.tag} reis online!`);
const actvs = [
`${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: "WATCHING" }
);
setInterval(() => {
client.user.setActivity(
actvs[Math.floor(Math.random() * (actvs.length - 1) + 1)],
{ type: "WATCHING" }
);
}, 5000);
client.user.setStatus("dnd");
});
client.on("messageCreate", (message) => {
if (message.author.bot) return;
msg = message.content.toLowerCase();
if (msg.startsWith(prefix + "cihan")) {
let monke = Math.floor(Math.random() * 4);
if (monke === 1) {
message.channel.send(":monkey_face:");
}
if (monke === 2) {
message.channel.send(":speak_no_evil:");
}
if (monke === 3) {
message.channel.send(":monkey:");
}
}
});
//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);
});
client.login(token);