mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 16:06:59 +01:00
#4 done. added qbucks, monthly and alltime leaderboards
This commit is contained in:
@@ -23,6 +23,10 @@ export async function getUserRecord(user: User): Promise<userRecord> {
|
||||
};
|
||||
};
|
||||
|
||||
export async function getAllUserRecords(): Promise<userRecord[]> {
|
||||
return await pb.getFullList();
|
||||
};
|
||||
|
||||
async function createUserRecord(user: User): Promise<userRecord> {
|
||||
const data = await pb.create({
|
||||
id: user.id,
|
||||
@@ -44,3 +48,11 @@ export async function updateUserRecord(user: User, newData: userRecord): Promise
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
export async function getBalanceLeaderboard() {
|
||||
try {
|
||||
return await pb.getList(1, 10, { sort: '-balance,id' }).then(a => a.items);
|
||||
} catch (err) {
|
||||
logger.err(err as string);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user