MCPcopy Create free account
hub / github.com/Slayer128/Carltech-Bot / addCron

Function addCron

lib/cron.js:28–44  ·  view source on GitHub ↗
(group_id, row, value)

Source from the content-addressed store, hash-verified

26
27// Function to create or update a cron entry
28async function addCron(group_id, row, value) {
29 try {
30 const data = loadCronData();
31
32 if (!data[group_id]) {
33 // Create new entry if it doesn't exist
34 data[group_id] = {};
35 }
36
37 // Update the specific field
38 data[group_id][row] = value;
39 saveCronData(data);
40 console.log(`Cron data updated for group_id: ${group_id}`);
41 } catch (error) {
42 console.error("Error while adding/updating cron data:", error);
43 }
44}
45
46// Function to get all cron entries
47async function getCron() {

Callers

nothing calls this directly

Calls 2

loadCronDataFunction · 0.85
saveCronDataFunction · 0.85

Tested by

no test coverage detected