-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
70 lines (62 loc) · 1.81 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
const {
Client,
GatewayIntentBits,
Partials,
Collection,
} = require("discord.js");
const fs = require("fs");
const { logger } = require("#functions/Logger.js");
const { Player, QueryType } = require("discord-player");
const { ClusterClient, getInfo } = require("discord-hybrid-sharding");
const { handleCrashes } = require("@arijitthedev/utils");
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates,
],
partials: [Object.keys(Partials)],
shards: getInfo().SHARD_LIST,
shardCount: getInfo().TOTAL_SHARDS,
});
client.logger = logger;
client.time = new Date().toLocaleTimeString("en-IN", {
timeZone: "Asia/Kolkata",
});
client.color = "#486FFA";
client.config = require("#root/config.js");
client.cluster = new ClusterClient(client);
const { loadEvents } = require("#root/Structures/Handlers/eventHandler.js");
const { loadDatabase } = require("#database/Database.js");
const { FakeYouClient } = require("#handlers/FakeYou.js");
client.commands = new Collection();
client.legacy = new Collection();
client.events = new Collection();
client.legacyCommands = new Array();
loadEvents(client);
loadDatabase(client);
FakeYouClient(client);
handleCrashes();
const InitPlayer = async () => {
const player = new Player(client);
await player.extractors
.loadDefault()
.then(() => {
client.logger("├─ Player Extractor Initiated.", "success");
})
.catch(() => {});
client.player = player;
};
InitPlayer();
client
.login(client.config.TOKEN)
.then(() => {
client.logger(
`├─ Logged in the client: ${client.user.username}`,
"success"
);
})
.catch((err) => {
client.logger(`├─ Error logging into the client: ${error}`, "warn");
});