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

@@ -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);
}
});