mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 09:26:58 +01:00
added invulnerable chatters, completely reworked the way vulnerable chatters and admins is stored
This commit is contained in:
@@ -15,10 +15,10 @@ export default new Item(ITEMNAME, 'Grenade', 's',
|
||||
async (msg, user) => {
|
||||
const userObj = await getUserRecord(user);
|
||||
if (userObj.inventory[ITEMNAME]! < 1) { await sendMessage(`You don't have any grenades!`, msg.messageId); return; };
|
||||
const targets = await redis.keys('vulnchatters:*');
|
||||
const targets = await redis.keys(`user:*:vulnerable`);
|
||||
if (targets.length === 0) { await sendMessage('No vulnerable chatters to blow up', msg.messageId); return; };
|
||||
const selection = targets[Math.floor(Math.random() * targets.length)]!;
|
||||
const target = await User.initUserId(selection.split(':')[1]!);
|
||||
const target = await User.initUserId(selection.slice(5, -11));
|
||||
|
||||
await getUserRecord(target!); // make sure the user record exist in the database
|
||||
|
||||
|
||||
Reference in New Issue
Block a user