Read current list of vips to sync with discord


I want to read all the VIPs through a custom script to an array (what I can currently get manually with ‘/vips’ in chat) and sync them to a Discord Role (if they linked their account with Discord)

Currently I’m doing this manually, checking 2 Lists… but I want to do this automatically through a script.

Is it easy possible to get the output from “/vips” to an array?

If you force the bot to run the /vips command in chat, the core/permissions.js script will automatically save the list of VIP’s to addons/vips.txt

You can also look at PhantomBot/permissions.js at master · PhantomBot/PhantomBot · GitHub to see how we parse it (use the ircPrivateMessage hook)

Ah okay - my output is in German and the code trys to parse this in englisch to get the vips - but maybe the bot will receive this in English - currently I don’t have a vip.txt in my folder - I will try later to (as you said) force the bot to use ‘/vips’ - with $.say(’/vips’) I hope? - I guess reading the vips later from the txt-file shouldn’t be the problem

That is correct.

If Twitch is saying “the vips of this channel are:” in German then the bot will ignore it, since it’s programmed for English. So you may need to create your own custom script to parse the German response, or edit the search string around line 801

Can’t we just add the strings to the language-files, so I just need to add a German translations for this?

The bot should always get the responses from Twitch in English, when changing it on site Twitch just translates it for you.

It worked for me now :slight_smile: vip-text-file was generated and I can now read the vips from the file :slight_smile: thanks for your help