(group_id, row, value)
| 26 | |
| 27 | // Function to create or update a cron entry |
| 28 | async 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 |
| 47 | async function getCron() { |
nothing calls this directly
no test coverage detected