mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
add randomchatter command, change silverbullet roulette timing
This commit is contained in:
22
src/commands/randomchatter.ts
Normal file
22
src/commands/randomchatter.ts
Normal 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);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user