mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 13:56:57 +01:00
reworks (thx dargkkast), more consistent lib functions, total item rework
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import { getInventory, updateInventory } from "../lib/userHelper";
|
||||
|
||||
export async function changeLootboxCount(username: string, amount = -1): Promise<itemChangeResult> {
|
||||
let inv = await getInventory(username)
|
||||
if (amount < 0 && inv.lootbox+ amount < 0) return {result: false, count: inv.lootbox}
|
||||
inv.lootbox += amount
|
||||
await updateInventory(username, inv)
|
||||
return {result: true, count: inv.lootbox}
|
||||
}
|
||||
Reference in New Issue
Block a user