Get a random *active* Twitch chatter

Hi. I’ve been trying to make a command which references a random user in the chat. At the moment we’re using: $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))
Which is the only solution I’ve been able to find, but the problem with that is that we don’t want it calling out lurkers, only active people actively participating in the chat.

Is there a way to find a random user who’s posted in the chat within a set amount of time in a custom command? Thanks.

Have you tried using Giveaways?

https://beta.nightbot.tv/giveaways

You can also type !winner to pick a random user who has spoken in the past 10 minutes

https://docs.nightbot.tv/commands/winner

It’s not for a giveaway; it’s basically a novelty command, but I’d like to get it right.

!winner is what makes me think it should be possible, but I have no idea how that command reaches it’s conclusion.

So the name of a random active user needs to appear alongside some other text?

Yes.

Sorry, minimum character limit. xD

I suggest making a new forum post requesting that a new variable, $(randomchatter x), where x is the number of minutes back to search for an active chatter, be added to Nightbot. I imagine that it would be pretty simple, since the default command !winner exists.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.