MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / handler

Function handler

plugins/listcmd.js:47–67  ·  view source on GitHub ↗
(sock, message, args, context)

Source from the content-addressed store, hash-verified

45 description: 'List all sticker commands',
46 usage: '.listcmd',
47 async handler(sock, message, args, context) {
48 const { chatId } = context;
49 const stickers = await getStickerCommands();
50 const entries = Object.entries(stickers);
51 if (entries.length === 0) {
52 return await sock.sendMessage(chatId, {
53 text: '✳️ No sticker commands found'
54 }, { quoted: message });
55 }
56 const stickerList = entries
57 .map(([key, value], index) => `${index + 1}. ${value.locked ? `*(blocked)* ${key}` : key} : ${value.text}`)
58 .join('\n');
59 const mentions = entries
60 .map(([, value]) => value.mentionedJid)
61 .flat()
62 .filter(Boolean);
63 await sock.sendMessage(chatId, {
64 text: `*CUSTOM STICKER COMMANDS*\n\n▢ *Info:* Custom commands set via .setcmd\n\n──────────────────\n${stickerList}`,
65 mentions
66 }, { quoted: message });
67 }
68};
69/*****************************************************************************
70 * *

Callers

nothing calls this directly

Calls 1

getStickerCommandsFunction · 0.70

Tested by

no test coverage detected