lmariscal / twitchirc

Twitch Bot Development made Easier | DEPRECATED
Other
40 stars 15 forks source link

onFollow event [Request] #26

Open FritzderWahre opened 6 years ago

FritzderWahre commented 6 years ago

Is it possible to create a onFollow event? Id like to see it in the next version,

mvarendorff commented 6 years ago

I just skimmed over the Twitch IRC Docs and couldn't find a trigger for that unfortunately. I will see if following a channel emmits anything undocumented in chat and write an update in about 8-9 hours but based on the documentation I won't find much I am afraid.

FritzderWahre commented 6 years ago

Sounds ok, thanks for help.

mvarendorff commented 6 years ago

Yeah as expected there is nothing in the IRC stream showing a follow. There is however a feature in the new TwitchAPI that allows reacting to follows. This however is not in the scope of IRC anymore. I could probably implement it though if @cavariux agrees :)

lmariscal commented 6 years ago

Hi @geisterfurz007 if you see it feasible and you have the time feel free to add it, even tho it isn't in the scope of the IRC it has been a long time asked feature. Thanks btw ;)

FritzderWahre commented 6 years ago

Yeah ok, but saww some bots that send a message with "thanks for following" a while ago.

mvarendorff commented 6 years ago

Yeah that is correct. The new twitch API has recently been released and supports this new feature for servers. Running such a server locally is possible and I am currently working on the code for it but it is not 100% sure it will work everywhere (my dorm has a strict network policy and certain ports blocked for example) so it is definitely easier to run this from a server but I am trying my best to get it to run locally :)

FritzderWahre commented 6 years ago

Thanks!

lmariscal commented 6 years ago

Also, the way the old bots worked for follower notifications was to keep a local copy of every follower and then verify with twitch api every x time if there was a new entry it showed the notification. Some developers just saved the last x followers but it permited follower notification repetition. So as you see the old format was mostly a pretty specific task for a server to do rather than a library that's why it wasn't added to the lib. The new way could come handy tho.

mvarendorff commented 6 years ago

I spent a few hours now trying to get this to work without success. The main issue is that Twitch's API requires a URL to send POST requests to whenever the event requested (in this case anyone following someone) occurs. Providing this URL is basically impossible when running local for me because I am either behind my dorms proxy, some unknown router of a VPN or on heroku where the code does not run properly because the implementation does not bind to a port but rather listens to it making heroku shut the process down after 90 seconds ignoring any incoming requests including the one twitch sends to verify the webhook subscription. So unfortunately for now I have to put this down as I have no way to provide the API with a useable callback URL. I am sorry.

FritzderWahre commented 6 years ago

Ok i understand, thanks for your help.

lmariscal commented 6 years ago

Will look if we can add something related, but sadly it comes out of the scope of this lib as it does require some web tools.

mvarendorff commented 6 years ago

Planning on implementing a polling algorithm for #30 as well so I am reopening this as reminder when starting on that in March.