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

Function getMessagesAndXPByJID

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

Source from the content-addressed store, hash-verified

45
46// Function to get messages and XP by JID
47async 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
64async function getBottom10Users() {

Callers

nothing calls this directly

Calls 1

loadUserDataFunction · 0.85

Tested by

no test coverage detected