forked from MarvinWariors/goatbotFiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHelp2
More file actions
135 lines (115 loc) ยท 4.96 KB
/
Help2
File metadata and controls
135 lines (115 loc) ยท 4.96 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
const fs = require("fs-extra");
const axios = require("axios");
const path = require("path");
const { getPrefix } = global.utils;
const { commands, aliases } = global.GoatBot;
const doNotDelete = "[ ๐ต | GoatBot V2 ]"; // changing this wont change the goatbot V2 of list cmd it is just a decoyy
module.exports = {
config: {
name: "help2",
version: "1.17",
author: "Vincent", // original author Armenion
countDown: 5,
role: 0,
shortDescription: {
en: "View command usage and list all commands directly",
},
longDescription: {
en: "View command usage and list all commands directly",
},
category: "info",
guide: {
en: "{pn} / help cmdName ",
},
priority: 1,
},
onStart: async function ({ message, args, event, threadsData, role }) {
const { threadID } = event;
const threadData = await threadsData.get(threadID);
const prefix = getPrefix(threadID);
if (args.length === 0) {
const categories = {};
let msg = "";
msg += `โโโโโโโฆโพโฆโโโโโโ\n โช๏ธ ๐ฉ๐๐ก๐๐๐ก๐ง ๐๐ ๐๐ฆ โช๏ธ\nโโโโโโโฆโพโฆโโโโโโ`; // replace with your name
for (const [name, value] of commands) {
if (value.config.role > 1 && role < value.config.role) continue;
const category = value.config.category || "Uncategorized";
categories[category] = categories[category] || { commands: [] };
categories[category].commands.push(name);
}
Object.keys(categories).forEach((category) => {
if (category !== "info") {
msg += `\nโญโโโโโโโโโโโ\nโ ใ ${category.toUpperCase()} ใ`;
const names = categories[category].commands.sort();
for (let i = 0; i < names.length; i += 3) {
const cmds = names.slice(i, i + 3).map((item) => `โฅ${item}`);
msg += `\nโ ${cmds.join(" ".repeat(Math.max(1, 10 - cmds.join("").length)))}`;
}
msg += `\nโฐโโโโโโโโโโโโ`;
}
});
const totalCommands = commands.size;
msg += `\n๐๐๐ฟ๐ฟ๐ฒ๐ป๐๐น๐, ๐๐ต๐ฒ ๐ฏ๐ผ๐ ๐ต๐ฎ๐ ${totalCommands} ๐ฐ๐ผ๐บ๐บ๐ฎ๐ป๐ฑ๐ ๐๐ต๐ฎ๐ ๐ฐ๐ฎ๐ป ๐ฏ๐ฒ ๐๐๐ฒ๐ฑ\n`;
msg += `๐ง๐๐ฝ๐ฒ ${prefix} ๐ต๐ฒ๐น๐ฝ ๐ฐ๐บ๐ฑ๐ก๐ฎ๐บ๐ฒ ๐๐ผ ๐๐ถ๐ฒ๐ ๐๐ต๐ฒ ๐ฑ๐ฒ๐๐ฎ๐ถ๐น๐ ๐ผ๐ณ ๐๐ต๐ฎ๐ ๐ฐ๐ผ๐บ๐บ๐ฎ๐ป๐ฑ\nโฐโโคDev: ๐ฉ๐๐ก๐๐๐ก๐ง ๐๐ฅ๐ ๐๐ก๐๐ข๐ก \nโฐโโคDev:m.me/100090775159086`;
msg += ` `; // its not decoy so change it if you want
const helpListImages = [
"https://i.imgur.com/V31vmPN.jpg", // add image link here
"https://i.imgur.com/8twZbuG.jpg",
"https://i.imgur.com/X7z9LVY.jpg",
"https://i.imgur.com/nKrLn9a.jpg",
"https://i.imgur.com/0NjTVtQ.jpg",
"https://i.imgur.com/FtQaROF.jpg",
"https://i.imgur.com/TqD3a7O.mp4",
"https://i.imgur.com/EfB6Ztv.jpg",
// Add more image links as needed
];
const helpListImage = helpListImages[Math.floor(Math.random() * helpListImages.length)];
await message.reply({
body: msg,
attachment: await global.utils.getStreamFromURL(helpListImage),
});
} else {
const commandName = args[0].toLowerCase();
const command = commands.get(commandName) || commands.get(aliases.get(commandName));
if (!command) {
await message.reply(`Command "${commandName}" not found.`);
} else {
const configCommand = command.config;
const roleText = roleTextToString(configCommand.role);
const author = configCommand.author || "Unknown";
const longDescription = configCommand.longDescription ? configCommand.longDescription.en || "No description" : "No description";
const guideBody = configCommand.guide?.en || "No guide available.";
const usage = guideBody.replace(/{p}/g, prefix).replace(/{n}/g, configCommand.name);
const response = `โญโโ NAME โโโโโโโ
โ ${configCommand.name}
โโโ INFO
โ Description: ${longDescription}
โ Other names: ${configCommand.aliases ? configCommand.aliases.join(", ") : "Do not have"}
โ Other names in your group: Do not have
โ Version: ${configCommand.version || "1.0"}
โ Role: ${roleText}
โ Time per command: ${configCommand.countDown || 1}s
โ Author: ${author}
โโโ Usage
โ ${usage}
โโโ Notes
โ The content inside <XXXXX> can be changed
โ The content inside [a|b|c] is a or b or c
โฐโโโโโโโโ`;
await message.reply(response);
}
}
},
};
function roleTextToString(roleText) {
switch (roleText) {
case 0:
return "0 (All users)";
case 1:
return "1 (Group administrators)";
case 2:
return "2 (Admin bot)";
default:
return "Unknown role";
}
}