Stack Exchange chat has no API. While this is not a complete chat API, it introduces a level of control that makes it far easier to run chatbots.
ArtOfChatbot is a two-part creation: a basic chatbot script, and an API to customise it. It is designed to be:
- completely in-browser
- easy to run
- easy to extend (with some JS knowledge)
You can find all the necessary code to run the chatbot here on Github. Simply paste it into your browser console and run it. You then have some customisation options:
chatAPI.setChatbotName(newName) - changes the chatbot's name. The name is displayed on all messages the chatbot sends.
chatAPI.addChatbotCommand(name, action) - when given a name and a function, this adds a command to the chatbot's recognised commands.
chatAPI.runChatbot() - the most important statement, runs the chatbot.
The chatbot comes with a few commands pre-installed. All commands are prefixed with
/help- displays a help message listing all the available commands.
/stop- a quick way for the person running the bot to stop it.
/low-quality <sitename>- finds a link to data for low-quality posts on the specified site.
/running?- a way for users to check if the bot is running.
This entire project is licensed under the GNU GPL license, version 3.
The code for the chatbot itself is also included. It is not intended to be used alone, but is also covered by the license so you are free to do as you wish with it.