How to get random user nickname from chat?

I need something like !commandname and reply like @mynickname, steal an apple from @[random user watching stream currently]

First determine a way to collect a list of names of people watching the stream. (Theres no official API)

You could collect a list of people whom has chatter in chat recently.
Poll the TMI chatters URL (thats just people in chat and is undocumented could change/break at any time)

Then add them to an array, shuffle that array a random number of times and grab one from a random point in the array.

Okay, thank you for quick reply.

This post was flagged by the community and is temporarily hidden.