(groupId, userId)
| 145 | |
| 146 | // Add these functions for warning system |
| 147 | async function incrementWarningCount(groupId, userId) { |
| 148 | try { |
| 149 | const data = loadUserGroupData(); |
| 150 | if (!data.warnings) data.warnings = {}; |
| 151 | if (!data.warnings[groupId]) data.warnings[groupId] = {}; |
| 152 | if (!data.warnings[groupId][userId]) data.warnings[groupId][userId] = 0; |
| 153 | |
| 154 | data.warnings[groupId][userId]++; |
| 155 | saveUserGroupData(data); |
| 156 | return data.warnings[groupId][userId]; |
| 157 | } catch (error) { |
| 158 | console.error('Error incrementing warning count:', error); |
| 159 | return 0; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | async function resetWarningCount(groupId, userId) { |
| 164 | try { |
no test coverage detected