Hosting A Basic Chat Bot (PHP?)

First of all, I would be very careful having a website being able to post to your chat. Make sure it’s behind some kind of login to verify who posts things trough it.

To see who is in chat on your website, the easiest way would be to use the twitch API for listing chatters http://tmi.twitch.tv/group/user/yourusername/chatters (full API reference: https://github.com/justintv/Twitch-API)

To interact with chat, create a socket connection to the chatservers in PHP. Have a look at the fsockopen documentation on how to do this: https://secure.php.net/manual/en/function.fsockopen.php

The twitch reference on connection via IRC and commands is found here: https://github.com/justintv/Twitch-API/blob/master/IRC.md

It is not really heavy on resources. I personally run a PHP based bot for a twitch channel on the $5 VPS plan on digitalocean.com. This since they have a location in San Fransisco, which as far as i have understood is also where the twitch chat servers are located. And I guess it should give me the lowest ping possible. But if you already have somewhere to run it from, I’m sure it will work just as fine.

I hope this is is enough to get you started. Let me know if you need more guidance or help.

1 Like