()
| 35 | } |
| 36 | ]; |
| 37 | async function loadUserGroupData() { |
| 38 | try { |
| 39 | if (HAS_DB) { |
| 40 | const data = await store.getSetting('global', 'userGroupData'); |
| 41 | return data || { groups: [], chatbot: {} }; |
| 42 | } |
| 43 | else { |
| 44 | return JSON.parse(fs.readFileSync(USER_GROUP_DATA, "utf-8")); |
| 45 | } |
| 46 | } |
| 47 | catch (error) { |
| 48 | console.error('Error loading user group data:', error.message); |
| 49 | return { groups: [], chatbot: {} }; |
| 50 | } |
| 51 | } |
| 52 | async function saveUserGroupData(data) { |
| 53 | try { |
| 54 | if (HAS_DB) { |
no outgoing calls
no test coverage detected