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

Function saveUserGroupData

plugins/chatbot.js:52–68  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

50 }
51}
52async function saveUserGroupData(data) {
53 try {
54 if (HAS_DB) {
55 await store.saveSetting('global', 'userGroupData', data);
56 }
57 else {
58 const dataDir = path.dirname(USER_GROUP_DATA);
59 if (!fs.existsSync(dataDir)) {
60 fs.mkdirSync(dataDir, { recursive: true });
61 }
62 fs.writeFileSync(USER_GROUP_DATA, JSON.stringify(data, null, 2));
63 }
64 }
65 catch (error) {
66 console.error('Error saving user group data:', error.message);
67 }
68}
69function getRandomDelay() {
70 return Math.floor(Math.random() * 3000) + 2000;
71}

Callers 1

handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected