(jid)
| 26 | |
| 27 | // Function to add or update the warning count for a user (jid) |
| 28 | async function ajouterUtilisateurAvecWarnCount(jid) { |
| 29 | try { |
| 30 | const data = loadWarnData(); |
| 31 | |
| 32 | // If the jid is already in the data, increment the warn count |
| 33 | if (data[jid]) { |
| 34 | data[jid].warn_count += 1; |
| 35 | } else { |
| 36 | // Otherwise, create a new entry with a warn_count of 1 |
| 37 | data[jid] = { warn_count: 1 }; |
| 38 | } |
| 39 | |
| 40 | saveWarnData(data); |
| 41 | console.log(`Utilisateur ${jid} ajouté ou mis à jour avec un warn_count de ${data[jid].warn_count}.`); |
| 42 | } catch (error) { |
| 43 | console.error("Erreur lors de l'ajout ou de la mise à jour de l'utilisateur :", error); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // Function to get the warning count for a user (jid) |
| 48 | async function getWarnCountByJID(jid) { |
nothing calls this directly
no test coverage detected