Screenshot / Code Snippet

Here's some sample usage:

cb = ChatBot.new(ENV['ChatXUsername'], ENV['ChatXPassword'])

cb.gen_hooks do
  room 63296 do # Room ID of The Closet, a testing room for ChatX
    command("!!/alive") { say "I'm alive!" }
    command "!!/sum" do |*args|
      say "The sum is: #{args.map(&:to_i).sum}"
    on "message" do |e|
      reply_to e, "You said: #{e.body}"

You can find more documentation and sample code in the README.


I built this library because I saw no suitable alternative for ruby, my favorite language. I also thought it'd be fun to reverse engineer SE Chat, so I did. Now I've got a project. Yay!


This project is released under the MIT License. Any contributions are welcome via pull requests. Feature requests can be made via issues or in chat.


Although the library is published on rubygems, the version there will frequently be outdated. To keep up to date please install from GitHub. The master branch should never be broken, so bundle update regularly. This is easy if you're using the bundler gem, you can just add the following line to your Gemfile:

gem 'chatx', git: 'https://gitlab.com/izwick-schachter/ChatX`, branch: 'master'


This library should work anywhere ruby will run. That means definitely macOS/Linux, and possibly windows.


I made this library (with some help from @ArtOfCode and others). If you are getting started, I know that documentation is poor, so please ping me in chat. I can be found in either of the two testing rooms for this library, Under the Bed and The Closet. Ping me whenever, I should respond within 48 hours.

In addition, if you have any feature requests, ping me in chat. I would be more than happy to try to add functions you need or to help you better use ChatX.



You must log in to answer this question.

Browse other questions tagged .