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

Function getStickerCommands

lib/messageHandler.js:36–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34const HAS_DB = !!(MONGO_URL || POSTGRES_URL || MYSQL_URL || SQLITE_URL);
35const STICKER_FILE = dataFile('sticker_commands.json');
36async function getStickerCommands() {
37 if (HAS_DB) {
38 const data = await store.getSetting('global', 'stickerCommands');
39 return data || {};
40 }
41 else {
42 try {
43 if (!fs.existsSync(STICKER_FILE)) {
44 return {};
45 }
46 return JSON.parse(fs.readFileSync(STICKER_FILE, 'utf8'));
47 }
48 catch {
49 return {};
50 }
51 }
52}
53async function handleMessages(sock, messageUpdate) {
54 try {
55 const { messages, type } = messageUpdate;

Callers 1

handleMessagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected