Repository navigation
Expand file tree
/
Copy pathcommandHandler.js
More file actions
93 lines (78 loc) · 1.84 KB
/
Copy pathcommandHandler.js
File metadata and controls
93 lines (78 loc) · 1.84 KB
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
const fs = require('fs');
const path = require('path');
const cmdsDir = path.join(__dirname, 'Cmds');
function findAllCommandFiles(dir) {
let commandFiles = [];
let totalCommands = 0;
function findFiles(directory) {
const files = fs.readdirSync(directory);
for (const file of files) {
const filePath = path.join(directory, file);
const stat = fs.statSync(filePath);
if (stat.isDirectory()) {
findFiles(filePath);
} else if (file.endsWith('.js')) {
commandFiles.push(filePath);
totalCommands++;
}
}
}
findFiles(dir);
return { commandFiles, totalCommands };
}
const { commandFiles, totalCommands } = findAllCommandFiles(cmdsDir);
const commands = {};
const aliases = {
speed: "ping",
kick: "remove",
mute: "close",
unmute: "open",
latency: "ping",
runtime: "uptime",
admin: "oadmin",
groups: "botgc",
bc: "broadcast",
pp: "fullpp",
kickall: "kill",
kickall2: "kill2",
exec: "shell",
leave: "leavegc",
left: "leavegc",
join: "joingc",
gh: "github",
ss: "screenshot",
ssweb: "ssweb",
help: "menu",
commands: "menu",
list: "menu",
repo: "script",
sc: "script",
linkgc: "link",
gclink: "link",
grouplink: "link",
linkgroup: "link",
mention: "tagall",
vv: "retrieve",
reset: "revoke",
mute: "close",
app: "apk",
fb: "fbdl",
facebook: "fbdl",
url: "upload",
tourl: "upload",
yta: "ytmp3",
ytv: "ytmp4",
mf: "mediafire",
emojimix: "emix",
enc: "encrypt",
req: "requests",
approve: "approve-all",
reject: "reject-all",
up: "uptime"
};
commandFiles.forEach((file) => {
const commandName = path.basename(file, '.js');
const commandModule = require(file);
commands[commandName] = commandModule;
});
module.exports = { commands, aliases, totalCommands };