fix !give negative numbers, !modme, automatic remod system (FUCK JAVASCRIPT)

This commit is contained in:
2025-04-08 23:43:27 +02:00
parent 9a2ce6b3a4
commit 7b6f8bc07f
4 changed files with 17 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ interface itemChangeResult {
inv?: inventory
}
export async function changeItemCount(user: HelixUser, item: string, amount = -1): Promise<itemChangeResult> {
export async function changeItemCount(user: HelixUser, item: string, amount = -1, preconfirmed=false): Promise<itemChangeResult> {
if (!ITEMS.includes(item)) return { result: false, reason: 'noexist', count: 0 }
let inv = await getInventory(user)
@@ -23,7 +23,7 @@ export async function changeItemCount(user: HelixUser, item: string, amount = -1
value: newcount,
})
if (amount > 0) await updateInventory(user, inv)
if (amount > 0 || preconfirmed === true) await updateInventory(user, inv)
return { result: true, reason: '', count: inv[item], inv }
}