MCPcopy
hub / github.com/mruniquehacker/Knightbot-MD / saveUserGroupData

Function saveUserGroupData

lib/index.js:38–52  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

36
37// Function to save user and group data to JSON file
38function saveUserGroupData(data) {
39 try {
40 const dataPath = path.join(__dirname, '../data/userGroupData.json');
41 // Ensure the directory exists
42 const dir = path.dirname(dataPath);
43 if (!fs.existsSync(dir)) {
44 fs.mkdirSync(dir, { recursive: true });
45 }
46 fs.writeFileSync(dataPath, JSON.stringify(data, null, 2));
47 return true;
48 } catch (error) {
49 console.error('Error saving user group data:', error);
50 return false;
51 }
52}
53
54// Add these functions to your SQL helper file
55async function setAntilink(groupId, type, action) {

Callers 15

setAntilinkFunction · 0.70
removeAntilinkFunction · 0.70
setAntitagFunction · 0.70
removeAntitagFunction · 0.70
incrementWarningCountFunction · 0.70
resetWarningCountFunction · 0.70
addSudoFunction · 0.70
removeSudoFunction · 0.70
addWelcomeFunction · 0.70
delWelcomeFunction · 0.70
addGoodbyeFunction · 0.70
delGoodByeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected