(jid)
| 45 | |
| 46 | // Function to get messages and XP by JID |
| 47 | async function getMessagesAndXPByJID(jid) { |
| 48 | try { |
| 49 | const data = loadUserData(); |
| 50 | |
| 51 | // Return user data if JID exists, otherwise default values |
| 52 | if (data[jid]) { |
| 53 | return { messages: data[jid].messages, xp: data[jid].xp }; |
| 54 | } else { |
| 55 | return { messages: 0, xp: 0 }; |
| 56 | } |
| 57 | } catch (error) { |
| 58 | console.error("Error retrieving user data:", error); |
| 59 | return { messages: 0, xp: 0 }; // Default values in case of error |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // Function to get the bottom 10 users by XP |
| 64 | async function getBottom10Users() { |
nothing calls this directly
no test coverage detected