NightDev Community Forums

Target multiple random users

I’ve tried to find some answer to what I’m trying to do to no avail. It’s probably out there and I just didn’t look in the right place. I’m trying to make a command similar to a !slap command, but one that picks 2 random users. What I have MAY work, but I can’t tell without having a chat going, so I figured I’d post what I came up with and see what y’all think.

!ship

$(user) ships $(touser) and $(touser) aren’t they cute together?

Hey @Zach_Eats_Games!

First of all, are you streaming on Youtube? You mention you can’t test without having a chat going, I want to make sure I understand properly on which platform you’re streaming.

Second, $(touser) is the first argument coming after the command, usually a viewer in this case, or if no argument is given it’ll be the user who initiated the command, so this won’t give you a random user.

A $(randomuser) variable was suggested as a new feature, but the devs didn’t have time to add it yet.

The reason why I’m asking on which platform you’re streaming is because on Youtube it’s impossible to get the viewers list yet, as there’s no API endpoint, therefore we can’t pick random users on Youtube.
If you’re streaming on Twitch however, this is possible, but you would be able to test commands even when you’re not streaming.

So if you’re streaming on Youtube, the closest you can get is the following command:

!addcom !ship $(user) ships $(1) and $(2), aren’t they cute together?

Where $(1) and $(2) are users added as an argument to the command, so it’d work like this:
!ship <user A> <user B>

Oh! I thought I selected twitch category.The reason I couldn’t tell if it was working was because with only me in the chat random or not all it could give me was my own name.

Oh, alright, I see then, since you’re streaming on Twitch, here’s one very basic solution:

$(user) ships $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel)) and $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel)), aren’t they cute together?

Thank you very much, Emily!