add randomchatter command, change silverbullet roulette timing

This commit is contained in:
2025-11-22 13:57:29 +01:00
parent acfba423ed
commit 55ad3d3b1c
5 changed files with 28 additions and 4 deletions

View File

@@ -149,6 +149,7 @@ COMMAND|FUNCTION|USER|ALIASES|DISABLEABLE
`qbucksleaderboard`|Get the current qbucks leaderboard [(info)](#leaderboards)|anyone|`qbucksleaderboard` `moneyleaderboard` `baltop`|:white_check_mark:
`anivtimeouts`|Get the amount of timeouts, dodges and dodge percentage from aniv timeouts [(info)](#aniv-timeouts)|anyone|`anivtimeouts` `anivtimeout`|:white_check_mark:
`racetime`|Get the racetime.gg room the streamer is currently in. Needs to have twitch linked to racetime account|anyone|`racetime` `raceroom`|:white_check_mark:
`randomchatter`|Get a random chatter for whatever reason|moderators|`randomchatter`|:white_check_mark:
### Qweribucks/Item commands

View File

@@ -32,7 +32,7 @@ export default new Cheer('execute', 666, async (msg, user) => {
targets: users.map(a => a.displayName),
finaltarget: target.displayName
});
await new Promise((res, _) => setTimeout(res, 6000));
await new Promise((res, _) => setTimeout(res, 4000));
} else {
target = await User.initUsername(args[0].toLowerCase());
};

View File

@@ -0,0 +1,22 @@
import { api } from "index";
import { Command, sendMessage } from "lib/commandUtils";
import { streamerId } from "main";
import { playAlert } from "web/alerts/serverFunctions";
export default new Command({
name: 'randomchatter',
aliases: ['randomchatter'],
usertype: 'moderator',
execution: async (msg) => {
const data = await api.chat.getChatters(streamerId).then(a => a.data);
const target = data[Math.floor(Math.random() * data.length)];
await playAlert({
name: 'blastinRoulette',
user: msg.chatterName,
targets: data.map(a => a.userDisplayName),
finaltarget: target?.userDisplayName
});
await new Promise((res, _) => setTimeout(res, 4000));
await sendMessage(`${target?.userDisplayName}`, msg.messageId);
}
});

View File

@@ -35,7 +35,7 @@ const eventSubPath = process.env.EVENTSUB_PATH;
await connectionCheck();
const CHATTERINTENTS = ["user:read:chat", "user:write:chat", "user:bot", "user:manage:whispers"];
const STREAMERINTENTS = ["channel:bot", "user:read:chat", "moderation:read", "channel:manage:moderators", "moderator:manage:chat_messages", "moderator:manage:banned_users", "bits:read", "channel:moderate", "moderator:manage:shoutouts", "channel:read:subscriptions", "channel:manage:redemptions"];
const STREAMERINTENTS = ["channel:bot", "user:read:chat", "moderation:read", "moderator:read:chatters", "channel:manage:moderators", "moderator:manage:chat_messages", "moderator:manage:banned_users", "bits:read", "channel:moderate", "moderator:manage:shoutouts", "channel:read:subscriptions", "channel:manage:redemptions"];
const users: authProviderInstructions[] = [
{

View File

@@ -8,6 +8,7 @@ import { timeout } from "lib/timeout";
import { playAlert } from "web/alerts/serverFunctions";
import User from "user";
import { redis } from "lib/redis";
import { streamerId } from "main";
const ITEMNAME = 'silverbullet';
@@ -26,7 +27,7 @@ export default new Item({
await user.setLock();
const userObj = await getUserRecord(user);
if (userObj.inventory[ITEMNAME]! < 1) { await sendMessage(`You don't have any silver bullets!`, msg.messageId); await user.clearLock(); return; };
if (userObj.inventory[ITEMNAME]! < 1 && user.id !== streamerId) { await sendMessage(`You don't have any silver bullets!`, msg.messageId); await user.clearLock(); return; };
let target: User | null;
if (!messagequery[0]) {
@@ -46,7 +47,7 @@ export default new Item({
targets: users.map(a => a.displayName),
finaltarget: target.displayName
});
await new Promise((res, _) => setTimeout(res, 6000));
await new Promise((res, _) => setTimeout(res, 4000));
} else {
target = await User.initUsername(messagequery[0].toLowerCase());
};