!addinvuln now clears wipes the inventory and wallet of the target

This commit is contained in:
2025-12-06 23:34:13 +01:00
parent fd0461a30f
commit 3aca8a9210
2 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
import { getUserRecord, updateUserRecord } from "db/dbUser";
import { emptyInventory } from "items";
import { Command, sendMessage } from "lib/commandUtils";
import { addInvuln } from "lib/invuln";
import parseCommandArgs from "lib/parseCommandArgs";
@@ -20,12 +22,16 @@ export default new Command({
return;
}
const data = await addInvuln(target.id);
if (data === "OK")
if (data === "OK") {
const userRecord = await getUserRecord(target);
userRecord.inventory = emptyInventory;
userRecord.balance = 0;
await updateUserRecord(target, userRecord);
await sendMessage(
`${target.displayName} is now an invuln`,
`${target.displayName} is now an invuln. Their inventory and wallet have been wiped`,
msg.messageId,
);
else
} else
await sendMessage(
`${target.displayName} is already an invuln`,
msg.messageId,