Basic connect and post to chat examples PHP

I was wondering if any of you kind folks could recommend any online examples of a very basic working chatbot in PHP - something that will do the connect, get messages and post messages.

I’ve been reading up all the ones I could find on Google but they’re all either several years old (which may or may not be a problem, I don’t know if this is a thing that Twitch have futzed with at all), or they’re very stuffed full of other functions which makes it confusing and complicated for my novice coder idiot brain, or they are specifically for using on your home computer not a remote web server and I’m entirely unclear on how to adapt those. Obviously I have read the Twitch docs as well, many, many times, but I don’t know how to turn their generic instructions into viable code!

I did post to the Twitch dev Discord to see if I could hire someone to get the basic setup done because once I’ve got the data and can get the bot’s account to post I can deal with everything else, but then got spammed and harrassed endlessly by scammers to the point I had to shut down half my social media accounts and change my phone number, so backing away from that plan! Unfortunately all the 3rd party chatbots we’ve tried out don’t have the features that we particularly need to work with our streaming setup. We’ve got all our commands on our web server so people can preview them and that already handles all our automatied channel rewards, so it would really just complete the thing if I could get the chatbot stuff up and running but I’m not qualified to do it alone!

I used to use a library called SmartIRC / On GitHub to build a chatbot in PHP.

Since Twitch Chat is just IRC this suffices.

You would likely need to patch the base library manually to add support for processing IRCv3 tags if you need access to tags.

These days I’ve moved on from using PHP for this.

Thank you for the suggestion, I understand PHP is not the optimal language to use for a chatbot, but it’s the only one I have any familiarity with (and by any I mean a little). Unfortunately we’re stuck on php 5.1, I’m not the admin for our web server and the person who is has been ignoring my requests to upgrade it for over a year now! I’ll have a thorough read of it anyway and see if it’s worth us relocating our hosting.

I’d have to turn the server on to check. but I’m fairly sure I was operating under php 5 with this lib :stuck_out_tongue:

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