Is it possible to create a command to select a random user in a YouTube livestream using Nightbot?
It isn’t possible to select a random user because YouTube doesn’t expose the list of users in chat. You could leverage the !winner
command to select a random recent chatter, with the caveat it only includes recent chatters.
I’d also like to create a similar command, for example:
!happy — the user has 20% happiness
!size — the user is 150 cm tall
But Nightbot needs to mention the username of the person who triggered the command, and give random values within a defined range.
For example, if I set happiness between 1 and 100, and height between 120 and 200.
How can I do that, please?
Check out the examples at https://docs.nightbot.tv/variables/eval for how to build a random number result. You can leverage other variables like https://docs.nightbot.tv/variables/user to show the person who used the command.