!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

@@ -19,6 +19,7 @@ Invulns don't need moderator or vip status in the channel.
The chatterbot and streamer always are invuln and cannot be stripped of this status. The chatterbot and streamer always are invuln and cannot be stripped of this status.
Moderators can add and remove invulns. Moderators can add and remove invulns.
On your first message in chat you will recieve 10 minutes of invuln status. On your first message in chat you will recieve 10 minutes of invuln status.
When a moderator adds you as invuln you will lose all items and qbucks.
### Bots ### Bots
@@ -186,7 +187,7 @@ COMMAND|FUNCTION|USER|ALIASES|DISABLEABLE
`getadmins`|Get a list of every admin in the channel|anyone|`getadmins`|:x: `getadmins`|Get a list of every admin in the channel|anyone|`getadmins`|:x:
`itemlock {target}`|Toggle the itemlock on the specified target|moderator|`itemlock`|:x: `itemlock {target}`|Toggle the itemlock on the specified target|moderator|`itemlock`|:x:
`testcheer {amount} [args]`|Create a fake cheering event|streamer/chatterbot|`testcheer`|:x: `testcheer {amount} [args]`|Create a fake cheering event|streamer/chatterbot|`testcheer`|:x:
`addinvuln {target}`|Adds an invuln user|moderator|`addinvuln`|:x: `addinvuln {target}`|Adds an invuln user and wipes the user's inventory and wallet|moderator|`addinvuln`|:x:
`removeinvuln {target}`|Removes an invuln user|moderator|`removeinvuln`|:x: `removeinvuln {target}`|Removes an invuln user|moderator|`removeinvuln`|:x:
`addbot {target}`|Adds bot status to a specific chatter|streamer/chatterbot|`addbot`|:x: `addbot {target}`|Adds bot status to a specific chatter|streamer/chatterbot|`addbot`|:x:
`removebot {target}`|Removes bot status from a specific chatter|streamer/chatterbot|`removebot`|:x: `removebot {target}`|Removes bot status from a specific chatter|streamer/chatterbot|`removebot`|:x:

View File

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