(jid)
| 46 | |
| 47 | // Function to get the warning count for a user (jid) |
| 48 | async function getWarnCountByJID(jid) { |
| 49 | try { |
| 50 | const data = loadWarnData(); |
| 51 | |
| 52 | // Return the warn_count of the user or 0 if the user doesn't exist |
| 53 | return data[jid] ? data[jid].warn_count : 0; |
| 54 | } catch (error) { |
| 55 | console.error("Erreur lors de la récupération du warn_count :", error); |
| 56 | return -1; // Return a default error value |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // Function to reset the warning count for a user (jid) |
| 61 | async function resetWarnCountByJID(jid) { |
nothing calls this directly
no test coverage detected