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

Function resetWarnCountByJID

lib/warn.js:61–76  ·  view source on GitHub ↗
(jid)

Source from the content-addressed store, hash-verified

59
60// Function to reset the warning count for a user (jid)
61async function resetWarnCountByJID(jid) {
62 try {
63 const data = loadWarnData();
64
65 // Reset the warn_count to 0 for the specified jid
66 if (data[jid]) {
67 data[jid].warn_count = 0;
68 saveWarnData(data);
69 console.log(`Le warn_count de l'utilisateur ${jid} a été réinitialisé à 0.`);
70 } else {
71 console.log(`Utilisateur ${jid} non trouvé.`);
72 }
73 } catch (error) {
74 console.error("Erreur lors de la réinitialisation du warn_count :", error);
75 }
76}
77
78module.exports = {
79 ajouterUtilisateurAvecWarnCount,

Callers

nothing calls this directly

Calls 2

loadWarnDataFunction · 0.85
saveWarnDataFunction · 0.85

Tested by

no test coverage detected