Custom command API


#1

Hi guys,

Is there an alternative you know of to the API I used for pulling a random subscriber?

This 1 is down for a while now:
https://api.rtainc.co/twitch/channels/CHANNEL/subs/random?format=I+choose…+[0]&token=TOKEN
Returns a random subscriber of the channel. Warning: this will be very slow if you have a lot of subs.

Regards Z


#2

You can make use of (random) in commands to pull a random user.

See the command variable documentation:


#3

yeah, but that doesn’t pull a random subscriber yet.


#4

There’s no way to do this as of right now. The only way would be to pull all of your subscribers from Twitch, then get a random one from the list. If you have more than 100 you need to make multiple calls, which then gets slow since we need to wait to not pass Twitch’s rate limits. That’s maybe why that API is down.


#5

Doesn’t PhantomBot already write to addons/subs.txt ? Depending on the behavior this might be used with (readfilerand).


#6

This topic was automatically closed after 30 days. New replies are no longer allowed.