Random Active User via variables

I would like to ask if there is another way how to pick a random active user via variables. I know the command !winner but I mean something like $(randomuser) or something like that, thanks.

1 Like

!commands add !slap $(user) has slapped $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel)).

You could use something like this, it picks a random person from the chat.

3 Likes

Well, that seems like it doesn’t work for me at all :confused: It says [empty response]…

1 Like

Works fine for me. Did you put your own channelname in there, and there has to be someone in your channel since its picking a random viewer. I edited something though, so it should not give an empty response anymore.

1 Like

Well, I just copy whole command and it didn’t work for me… And yes, I put right channelname in there. Still returning: Nightbot: BlabosCZ has slapped Empty viewer list even though there are viewers in chat.

1 Like

Ah, I think I found the problem, apparently capital letters are not allowed. You don’t have to change anything, the code will change the channelname to lowercase, so just try again.

1 Like

Oh, thanks! It works for me now :slight_smile:

1 Like

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