-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
94 lines (60 loc) · 2.66 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const startCode0 = async () => {
require('./src/start-up/update-console-log');
require('./src/start-up/process-exit');
const Constants = require('./data/constants');
const { Client, Events, GatewayIntentBits, Partials } = require('discord.js');
const dotenv = require('dotenv');
const os = require('os');
global.isDevelopment = os.platform() === 'win32';
dotenv.config({ path: global.isDevelopment ? '.env' : 'server.env' });
// global.isDevelopment = false; // Manuel override
global.mainDir = __dirname;
global.mongoClient = null;
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildModeration,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageTyping
], partials: [
Partials.Message,
Partials.Channel,
Partials.Reaction
]
});
client.awaitaction = {};
client.startDate = Date.now();
require('./src/dc-client/load-languages').load(client);
require('./src/dc-client/language-file-check');
await require('./src/start-up/mongo-setup').connect();
require('./src/start-up/start-puppeteer');
require('./src/web-server/http-server').setup(client);
client.once(Events.ClientReady, readyClient => {
require('./src/dc-guild/discord-fetch').fetch(client);
require('./src/interactions/load-interactions').load(client);
require('./src/start-up/mongodb-check');
require('./src/dc-guild/audit-log').setup(client);
require('./src/dc-client/client-status').start(client);
console.log(`\nCode0 Discord Client ready => ${readyClient.user.tag}`, Constants.CONSOLE.GOOD);
require('./src/dc-guild/stats-message').start(client);
require('./src/dc-guild/stats-voice-channel').start(client);
require('./src/dc-guild/webhook-commit-filter').start(client);
require('./src/dc-guild/user-stats').start(client);
require('./src/dc-guild/git-rank').setup(client);
});
require('./src/dc-client/debug-log').setup(client);
client.login(process.env.TOKEN);
}
startCode0();
/* TODO
-> Discord Audit log Embeds [Todo since: 28.04.2024]
-> Remove ticket when user left the server
-> command to display overall commits, with carry over for all days
-> pie chart for repos (WIP) [since 11.08.2024]
-> update modules like DiscordSimpleTable, etc [11.08.2024]
-> debug remove double users [15.08.2024]
*/