Random Active User via variables


#1

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.


#2

!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, just change ‘yourchannel’ to the channelname.


Generating random people in chat
Useful Custom APIs
#3

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


#4

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.


#5

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.


#6

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.


#7

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


#8

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