mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 04:01:40 +01:00
minor fixes, add superloot cheer
This commit is contained in:
@@ -41,7 +41,7 @@ export class Item {
|
||||
};
|
||||
|
||||
import { readdir } from 'node:fs/promises';
|
||||
import { updateUserRecord, type inventoryUpdate } from "db/dbUser";
|
||||
import { updateUserRecord, type UserRecord } from "db/dbUser";
|
||||
const itemAliasMap = new Map<string, Item>;
|
||||
const itemObjectArray: Item[] = []
|
||||
const specialAliasItems = new Map<string, Item>;
|
||||
@@ -72,7 +72,7 @@ export type inventory = {
|
||||
[key in items]?: number;
|
||||
};
|
||||
|
||||
export async function changeItemCount(user: User, userRecord: inventoryUpdate, itemname: items, amount = -1): Promise<false | inventoryUpdate> {
|
||||
export async function changeItemCount(user: User, userRecord: UserRecord, itemname: items, amount = -1): Promise<false | UserRecord> {
|
||||
userRecord.inventory[itemname] = userRecord.inventory[itemname]! += amount;
|
||||
if (userRecord.inventory[itemname] < 0) return false;
|
||||
await updateUserRecord(user, userRecord);
|
||||
|
||||
Reference in New Issue
Block a user