11

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.

About

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.

Commands

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.
  • /champagne - Party!
  • /running? - a way for users to check if the bot is running.

License

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.

2
  • 1
    could you please make it a user script.
    – Mohammad
    Commented Apr 23, 2015 at 18:20
  • 1
    @Mhmd I can only make certain parts of it into a userscript: the customisations will still have to be run from the browser console.
    – ArtOfCode
    Commented Apr 23, 2015 at 18:37

0

You must log in to answer this question.

Browse other questions tagged .