mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 14:06:59 +01:00
moving to postgres, part 2
This commit is contained in:
@@ -40,7 +40,12 @@ export async function getItemStats(target: User, thismonth: boolean) {
|
||||
]);
|
||||
if (!items || !cheers) return;
|
||||
|
||||
const returnObj: inventory = {};
|
||||
const returnObj: inventory = {
|
||||
blaster: 0,
|
||||
silverbullet: 0,
|
||||
grenade: 0,
|
||||
tnt: 0,
|
||||
};
|
||||
|
||||
for (const item of items) {
|
||||
if (!returnObj[item.item]) returnObj[item.item] = 0;
|
||||
@@ -48,8 +53,8 @@ export async function getItemStats(target: User, thismonth: boolean) {
|
||||
};
|
||||
|
||||
for (const cheer of cheers) {
|
||||
if (!returnObj[cheer.cheer]) returnObj[cheer.cheer] = 0;
|
||||
returnObj[cheer.cheer]! += 1
|
||||
if (!returnObj[cheer.event]) returnObj[cheer.event] = 0;
|
||||
returnObj[cheer.event]! += 1
|
||||
};
|
||||
|
||||
return returnObj;
|
||||
|
||||
Reference in New Issue
Block a user