MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / incrementWarningCount

Function incrementWarningCount

lib/index.js:147–161  ·  view source on GitHub ↗
(groupId, userId)

Source from the content-addressed store, hash-verified

145
146// Add these functions for warning system
147async 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
163async function resetWarningCount(groupId, userId) {
164 try {

Callers 2

AntilinkFunction · 0.85
handleBadwordDetectionFunction · 0.85

Calls 2

loadUserGroupDataFunction · 0.70
saveUserGroupDataFunction · 0.70

Tested by

no test coverage detected