Subscriber count at 0

PhantomBot Version: 3.1.2
OS Version: Ubuntu Server 18.04
Java Version:
Browser and Version (for Panel Support): Brave and Chrome - Latest version
Stock PhantomBot: Yes

Let us know what help you need:
I’m trying to make a !subs command and the command itself is indeed working but the bot outputs “0” when it is supposed to output quite a higher number :slight_smile:

I’ve tried doing as described here:

I made sure it was the STREAM user (not bot user) and it was the APIOAUTH I changed in the botlogin.txt file.

I hope you are able to assist in this matter.

Best regards.

i run a bot for a streamer and i dont have there apioauth so it seems to read subcount of what ever apioauth account is attached. mine says 0 as well

Any news from any devs who might know the answer? :slight_smile:

This requires an apioauth from the target streamer, otherwise Twitch will refuse to provide the requested information.

If you think there is still an error in the output, you can edit scripts/core/streamInfo.js, find getSubscriberCount(), and add the following on line 418 (right above the if)

$.consoleLn("getSubscriberCount() returned HTTP " + jsonObject.getInt('_http'));

This will print to console what the HTTP status code is. If you get something other than 200, then you are erroring out

I did get a brand new apioauth key from my streamer account, but still outputs (0).

My bot is, however, running on a Linux server started using systemctl.
Should I run the bot manually using ./ for the mentioned output test in console?


You can use sudo journalctl -b -u phantombot to see the console output. Replace phantombot with the service name you used

I’m not sure but there might be an issue with this API

Hi again.

I cannot find what you mentioned on line 418.
I can however find something further up the code as shown here:

Is that the area you mean?

Thank you!

Yes, line 393 is where the addition should go

I get this error in the console when doing that:

May 18 15:19:04 Ubuntu-1804-bionic-64-minimal[4405]: [05-18-2020 @ 13:19:04.253 GMT] [ERROR] [init.js:317] Error with Event Handler [command] Script [./commands/customCommands.js] Stacktrace [getSubscriberCount()@stream
May 18 15:19:04 Ubuntu-1804-bionic-64-minimal[4405]: .]

Here, use this

streamInfo.js (18.1 KB)

I can’t seem to download the file?

I get this error:

ZACK!!! SwiftRage

Copy-paste from here. Replace everything in the file

Same error:

May 18 15:33:40 Ubuntu-1804-bionic-64-minimal[5056]: [05-18-2020 @ 13:33:40.092 GMT] [ERROR] [init.js:317] Error with Event Handler [command] Script [./commands/customCommands.js] Stacktrace [getSubscriberCount()@stream
May 18 15:33:40 Ubuntu-1804-bionic-64-minimal[5056]: .]

I messed up the code :stuck_out_tongue:


Now I’m getting this:

> May 18 15:48:19 Ubuntu-1804-bionic-64-minimal[5717]: [05-18-2020 @ 13:48:19.699 GMT] getSubscriberCount() returned HTTP 401
> May 18 15:48:19 Ubuntu-1804-bionic-64-minimal[5717]: [05-18-2020 @ 13:48:19.701 GMT] [CHAT] 0

I have about 40 subs, so that count is incorrect :smiley:

Should I try with yet another new apioauth key?

I tried a new apioauth key - It didn’t work.
I got no clue what the above mentioned http 401 error is :frowning:

401 means Unauthorized

Okay, so why isn’t it authorized when I just added a new key for the streamer?

I think they messed up the oauth on and are not requesting the correct permissions. Try generating a new apioauth on this website:

I might be misplacing some authkeys perhaps?

Can you explain number 1 - 4 as shown here?

1 is currently streamer apioauth
2 is bot oauth
3 and 4 is most likely generated automatically for webpanel access?

Thank! :slight_smile:

You want to put this key for the apioauth= line, but use the new link I just posted to get it