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

Function getStickerCommands

plugins/setcmd.ts:31–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29const STICKER_FILE = dataFile('sticker_commands.json');
30
31async function getStickerCommands() {
32 if (HAS_DB) {
33 const data = await store.getSetting('global', 'stickerCommands');
34 return data || {};
35 } else {
36 try {
37 const dir = path.dirname(STICKER_FILE);
38 if (!fs.existsSync(dir)) {
39 fs.mkdirSync(dir, { recursive: true });
40 }
41 if (!fs.existsSync(STICKER_FILE)) {
42 fs.writeFileSync(STICKER_FILE, JSON.stringify({}));
43 return {};
44 }
45 return JSON.parse(fs.readFileSync(STICKER_FILE, 'utf8'));
46 } catch {
47 return {};
48 }
49 }
50}
51
52async function saveStickerCommands(data: any) {
53 if (HAS_DB) {

Callers 1

handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected