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

Function getStickerCommands

plugins/listcmd.js:24–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22const HAS_DB = !!(MONGO_URL || POSTGRES_URL || MYSQL_URL || SQLITE_URL);
23const STICKER_FILE = dataFile('sticker_commands.json');
24async function getStickerCommands() {
25 if (HAS_DB) {
26 const data = await store.getSetting('global', 'stickerCommands');
27 return data || {};
28 }
29 else {
30 try {
31 if (!fs.existsSync(STICKER_FILE)) {
32 return {};
33 }
34 return JSON.parse(fs.readFileSync(STICKER_FILE, 'utf8'));
35 }
36 catch {
37 return {};
38 }
39 }
40}
41export default {
42 command: 'listcmd',
43 aliases: ['cmdlist'],

Callers 1

handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected