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

Function getStickerCommands

plugins/delcmd.js:11–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9const HAS_DB = !!(MONGO_URL || POSTGRES_URL || MYSQL_URL || SQLITE_URL);
10const STICKER_FILE = dataFile('sticker_commands.json');
11async function getStickerCommands() {
12 if (HAS_DB) {
13 const data = await store.getSetting('global', 'stickerCommands');
14 return data || {};
15 }
16 else {
17 try {
18 if (!fs.existsSync(STICKER_FILE)) {
19 return {};
20 }
21 return JSON.parse(fs.readFileSync(STICKER_FILE, 'utf8'));
22 }
23 catch {
24 return {};
25 }
26 }
27}
28async function saveStickerCommands(data) {
29 if (HAS_DB) {
30 await store.saveSetting('global', 'stickerCommands', data);

Callers 1

handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected