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

Function getWarnCountByJID

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

Source from the content-addressed store, hash-verified

46
47// Function to get the warning count for a user (jid)
48async 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)
61async function resetWarnCountByJID(jid) {

Callers

nothing calls this directly

Calls 1

loadWarnDataFunction · 0.85

Tested by

no test coverage detected