mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
!addinvuln now clears wipes the inventory and wallet of the target
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user