This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edp.selfbot
59 lines (42 loc) · 1.47 KB
/
edp.selfbot
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 Discord = require('discord.js');
const client = new Discord.Client();
const fs = require('fs');
const config = require('./config');
const Logger = require('./functions/logger');
let start = Date.now();
fs.readdir('./commands/', (error, files) => {
if(error) {
throw new Error(error);
}
client.commands = [];
files.map((file) => {
client.commands[file.replace(/\..*/, '')] = require('./commands/' + file);
if (files.indexOf(file) === files.length - 1) {
Logger.start('Loaded ' + files.length + ' commands! (' + (Date.now() - start) + ' ms)');
fs.readdir('./events/', (error, files) => {
if(error) {
throw new Error(error);
}
files.map((file) => {
let eventRunner = require('./events/' + file);
let eventName = file.split('.')[0];
client.on(eventName, (...args) => eventRunner(client, ...args));
if (files.indexOf(file) === files.length - 1) {
Logger.start('Loaded ' + files.length + ' events! (' + (Date.now() - start) + ' ms)');
client.login(config.discord.token);
client.config = config;
}
});});
fs.readdir('./functions/', (error, files) => {
if(error) {
throw new Error(error);
}
files.map((file) => {
let functionRunner = require('./functions/' + file);
let functionName = file.split('.')[0];
client.on(functionName, (...args) => functionRunner(client, ...args));
if (files.indexOf(file) === files.length - 1) {
Logger.start('Loaded ' + files.length + ' functions! (' + (Date.now() - start) + ' ms)');
}
});});}});
});