-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
73 lines (61 loc) · 1.88 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
67
68
69
70
71
72
73
const Discord = require("discord.js");
const { Client, Message, MessageEmbed, Collection } = require("discord.js");
const colors = require("colors");
const fs = require("fs");
const emojis = require("./config/emojis.json")
const config = require("./config/config.json")
// require('canvas').registerFont("Genta.ttf", {
// family: "Genta"
// }); //loading a font
// client define
const client = new Client({
messageCacheLifetime: 60,
fetchAllMembers: false,
messageCacheMaxSize: 10,
restTimeOffset: 0,
restWsBridgetimeout: 100,
shards: "auto",
disableEveryone: true,
partials: ["MESSAGE", "CHANNEL", "REACTION"],
presence : {
status : "dnd",
}
});
module.exports = client;
const mongoose = require("mongoose");
mongoose
.connect(config.mongo, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true,
})
.then(console.log(
`
..............................................................................
........................ Mongo DB Connected ..................................
..............................................................................
`
));
client.setMaxListeners(50);
require('events').defaultMaxListeners = 50;
// //Loading discord-buttons
const dbs = require('discord-buttons');
dbs(client);
// Global Variables
client.commands = new Collection();
client.aliases = new Collection();
client.events = new Collection();
client.cooldowns = new Collection();
client.category = fs.readdirSync("./commands/");
client.db = require('quick.db')
function requirehandlers() {
client.basicshandlers = Array(
"command", "events", "distube"
);
client.basicshandlers.forEach(handler => {
try { require(`./handlers/${handler}`)(client); } catch (e) { console.log(e) }
});
} requirehandlers();
client.login(config.token);
module.exports.requirehandlers = requirehandlers;