goat
command
help
No description
0
views
0
likes
0
installs
raw source
const { getPrefix } = global.utils;
const { commands, aliases } = global.GoatBot;
function fancyText(text) {
const map = {
'a': '๐บ', 'b': '๐ป', 'c': '๐ผ', 'd': '๐ฝ', 'e': '๐พ', 'f': '๐ฟ', 'g': '๐', 'h': '๐', 'i': '๐',
'j': '๐', 'k': '๐', 'l': '๐
', 'm': '๐', 'n': '๐', 'o': '๐', 'p': '๐', 'q': '๐', 'r': '๐',
's': '๐', 't': '๐', 'u': '๐', 'v': '๐', 'w': '๐', 'x': '๐', 'y': '๐', 'z': '๐',
'A': '๐ ', 'B': '๐ก', 'C': '๐ข', 'D': '๐ฃ', 'E': '๐ค', 'F': '๐ฅ', 'G': '๐ฆ', 'H': '๐ง', 'I': '๐จ',
'J': '๐ฉ', 'K': '๐ช', 'L': '๐ซ', 'M': '๐ฌ', 'N': '๐ญ', 'O': '๐ฎ', 'P': '๐ฏ', 'Q': '๐ฐ', 'R': '๐ฑ',
'S': '๐ฒ', 'T': '๐ณ', 'U': '๐ด', 'V': '๐ต', 'W': '๐ถ', 'X': '๐ท', 'Y': '๐ธ', 'Z': '๐น'
};
return text.split("").map(c => map[c] || c).join("");
}
const categoryEmoji = (category) => {
const emojiMap = {
'info': '๐',
'information': 'โน๏ธ',
'system': 'โ๏ธ',
'bot': '๐ค',
'admin': '๐',
'administration': '๐',
'owner': '๐๏ธ',
'group': '๐ฅ',
'groups': '๐ฅ',
'fun': '๐ฎ',
'entertainment': '๐ญ',
'game': '๐ฒ',
'games': '๐ฎ',
'media': '๐ต',
'music': '๐ถ',
'audio': '๐ต',
'video': '๐ฌ',
'utility': '๐ง',
'tools': '๐ ๏ธ',
'economy': '๐ฐ',
'money': '๐ธ',
'banking': '๐ฆ',
'image': '๐ผ๏ธ',
'photo': '๐ธ',
'picture': '๐ผ๏ธ',
'education': '๐',
'learning': '๐',
'nsfw': '๐',
'adult': '๐',
'chat': '๐ฌ',
'communication': '๐ฌ',
'ai': '๐ค',
'artificial intelligence': '๐ง ',
'search': '๐',
'productivity': '๐',
'security': '๐ก๏ธ',
'privacy': '๐',
'misc': '๐ฆ',
'miscellaneous': '๐ฆ',
'other': '๐ญ',
'action': '๐ฏ',
'interaction': '๐ค',
'creative': '๐จ',
'design': 'โ๏ธ',
'data': '๐',
'analytics': '๐',
'gaming': '๐ฎ',
'world': '๐',
'geography': '๐บ๏ธ',
'social': '๐ฑ',
'social media': '๐ฑ',
'food': '๐',
'drink': '๐น',
'love': '๐',
'romance': '๐',
'friendship': '๐ค',
'family': '๐จโ๐ฉโ๐งโ๐ฆ',
'health': '๐ฅ',
'fitness': '๐ช',
'sports': 'โฝ',
'travel': 'โ๏ธ',
'shopping': '๐๏ธ',
'business': '๐ผ',
'work': '๐ผ',
'study': '๐',
'book': '๐',
'movie': '๐ฌ',
'tv': '๐บ',
'anime': '๐ฏ๐ต',
'manga': '๐',
'comic': '๐',
'cartoon': '๐ผ๏ธ',
'art': '๐จ',
'drawing': 'โ๏ธ',
'painting': '๐จ',
'photography': '๐ท',
'nature': '๐ฟ',
'animal': '๐ถ',
'pet': '๐พ',
'car': '๐',
'vehicle': '๐',
'technology': '๐ป',
'computer': '๐ป',
'phone': '๐ฑ',
'internet': '๐',
'web': '๐',
'network': '๐',
'science': '๐ฌ',
'math': '๐งฎ',
'physics': 'โ๏ธ',
'chemistry': '๐งช',
'biology': '๐งฌ',
'history': '๐',
'culture': '๐',
'religion': '๐',
'spiritual': '๐',
'weather': '๐ค๏ธ',
'time': '๐',
'date': '๐
',
'calendar': '๐
',
'reminder': 'โฐ',
'alarm': 'โฐ',
'timer': 'โฑ๏ธ',
'stopwatch': 'โฑ๏ธ',
'counter': '๐ข',
'default': '๐'
};
const cat = category.toLowerCase();
if (emojiMap[cat]) {
return emojiMap[cat];
}
for (const [key, emoji] of Object.entries(emojiMap)) {
if (cat.includes(key) || key.includes(cat)) {
return emoji;
}
}
return emojiMap.default;
};
module.exports = {
config: {
name: "help",
version: "2.4",
author: "Azadx69x",
role: 0,
countDown: 5,
description: {
en: "๐ Show command list or command details"
},
category: "Info",
guide: {
en: "{pn} [command_name]"
}
},
onStart: async function ({ message, args, event, role }) {
const prefix = getPrefix(event.threadID);
const input = args[0]?.toLowerCase();
let cmd = null;
if (input) {
if (commands.has(input)) {
cmd = commands.get(input);
} else if (aliases.has(input)) {
cmd = commands.get(aliases.get(input));
} else {
return message.reply(
`โโโโ[ โ ๐ก๐ข๐ง ๐๐ข๐จ๐ก๐ ]โโโโ
โโฅ ๐ ๐๐ผ๐บ๐บ๐ฎ๐ป๐ฑ: "${input}"
โโฅ ๐ ๐จ๐๐ฒ: ${prefix}๐ต๐ฒ๐น๐ฝ
โโฅ ๐ณ๐ผ๐ฟ ๐ฎ๐น๐น ๐ฐ๐ผ๐บ๐บ๐ฎ๐ป๐ฑ๐
โโโโโโโโโโโโโโโโโโโโโโโ`
);
}
}
if (cmd) {
const cfg = cmd.config;
const desc = typeof cfg.description === "string" ? cfg.description : cfg.description?.en || "โ ๐ก๐ผ ๐ฑ๐ฒ๐๐ฐ๐ฟ๐ถ๐ฝ๐๐ถ๐ผ๐ป";
const usage = typeof cfg.guide?.en === "string" ?
cfg.guide.en.replace(/\{pn\}/g, prefix + cfg.name) :
`${prefix}${cfg.name}`;
const aliasesList = cfg.aliases ?
cfg.aliases.map(a => `${prefix}${a}`).join(", ") :
"โ ๐ก๐ผ๐ป๐ฒ";
const helpMessage = `โโโโ[ ๐ RS. ๐๐ข๐ง ๐๐๐๐ฃ ]โโโโ
โโฅ ๐ ๐ก๐ฎ๐บ๐ฒ: ${prefix}${cfg.name}
โโฅ ๐๏ธ ๐๐ฎ๐๐ฒ๐ด๐ผ๐ฟ๐: ${categoryEmoji(cfg.category || "other")} ${cfg.category || "โ ๐จ๐ป๐ฐ๐ฎ๐๐ฒ๐ด๐ผ๐ฟ๐ถ๐๐ฒ๐ฑ"}
โโฅ ๐ ๐๐ฒ๐๐ฐ๐ฟ๐ถ๐ฝ๐๐ถ๐ผ๐ป: ${desc}
โโฅ โ๏ธ ๐ฉ๐ฒ๐ฟ๐๐ถ๐ผ๐ป: ${cfg.version || "1.0"}
โโฅ โณ ๐๐ผ๐ผ๐น๐ฑ๐ผ๐๐ป: ${cfg.countDown || 1}s
โโฅ ๐ ๐ฅ๐ผ๐น๐ฒ: ${cfg.role === 0 ? "๐ค ๐๐น๐น" : cfg.role === 1 ? "๐ ๐๐ฑ๐บ๐ถ๐ป" : "โก ๐ข๐๐ป๐ฒ๐ฟ"}
โโฅ ๐ ๐๐๐๐ต๐ผ๐ฟ: ${cfg.author || "โ ๐จ๐ป๐ธ๐ป๐ผ๐๐ป"}
โโฅ ๐ค ๐๐น๐ถ๐ฎ๐๐ฒ๐: ${aliasesList}
โโโโ[ ๐ ๐จ๐ฆ๐๐๐ ]โโโโ
${usage.split('\n').map(line => `โโฅ ${line}`).join('\n')}
โโโโ[ ๐ก ๐ก๐ข๐ง๐๐ฆ ]โโโโ
โโฅ <text> = Replaceable content
โโฅ [a|b] = Choose option a or b
โโฅ ( ) = Optional parameter
โโฅ {pn} = Bot prefix
โโโโโโโโโโโโโโโโโโโโโโโ`;
try {
await message.reply({
body: helpMessage,
attachment: await global.utils.getStreamFromURL("https://files.catbox.moe/9ti44b.mp4")
});
} catch (error) {
console.log("GIF attachment failed, sending text only:", error);
await message.reply(helpMessage);
}
return;
}
const categories = {};
for (const [, c] of commands) {
if (c.config.role > role) continue;
const cat = c.config.category || "Uncategorized";
if (!categories[cat]) categories[cat] = [];
categories[cat].push(c.config.name);
}
let msg = `โโโโ[ ๐ RSโข ๐๐ข๐ง ๐ ๐๐ก๐จ ]โโโโ\n`;
const sortedCategories = Object.keys(categories).sort();
for (const cat of sortedCategories) {
const categoryName = fancyText(cat.toUpperCase());
const commandsList = categories[cat].sort();
msg += `โโโโ[ ${categoryEmoji(cat)} ${categoryName} ]โโโโ\n`;
for (let i = 0; i < commandsList.length; i += 2) {
const cmd1 = commandsList[i];
const cmd2 = commandsList[i + 1];
const line = cmd2 ?
`โโฅ ${cmd1.padEnd(15)} ${cmd2}` :
`โโฅ ${cmd1}`;
msg += line + "\n";
}
msg += "โโโโโโโโโโโโโโโโโโโโโโโโ\n";
}
const totalCommands = Object.values(categories).flat().length;
msg += `โโโโ[ ๐ ๐ฆ๐ง๐๐ง๐ฆ ]โโโโ
โโฅ ๐ง๐ผ๐๐ฎ๐น ๐๐ผ๐บ๐บ๐ฎ๐ป๐ฑ๐: ${totalCommands}
โโฅ ๐ง๐ผ๐๐ฎ๐น ๐๐ฎ๐๐ฒ๐ด๐ผ๐ฟ๐ถ๐ฒ๐: ${sortedCategories.length}
โโฅ ๐๐น๐น ๐ฐ๐ผ๐บ๐บ๐ฎ๐ป๐ฑ๐ ๐ถ๐ป ๐ผ๐ป๐ฒ ๐ฝ๐ฎ๐ด๐ฒ
โโโโ[ ๐ ๐๐ก๐๐ข ]โโโโ
โโฅ ๐ช๐ฒ๐น๐ฐ๐ผ๐บ๐ฒ ๐๐ผ RSโข ๐๐ผ๐!
โโฅ ๐ฃ๐ฟ๐ฒ๐ณ๐ถ๐
: [ ${prefix} ]
โโฅ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐ฒ๐ฟ: RSโขRIFAT
โโฅ ๐จ๐๐ฒ: ${prefix}๐ต๐ฒ๐น๐ฝ <๐ฐ๐ผ๐บ๐บ๐ฎ๐ป๐ฑ>
โโโโโโโโโโโโโโโโโโโโโโโโ`;
try {
await message.reply({
body: msg,
attachment: await global.utils.getStreamFromURL("https://files.catbox.moe/9ti44b.mp4")
});
} catch (error) {
console.log("GIF attachment failed, sending text only:", error);
await message.reply(msg);
}
}
};