Gem Version CI codecov Maintainability Inline docs FOSSA Status

A light-weight Mirai QQ bot http interface lib for Ruby.

中文 | Rubydocs


This library is designed specifically for integration with mirai-api-http. Mirai is a QQ bot framework. The relationship is like this:

mirai <-jvm-> mirai-console <-plugin-> mirai-api-http <-http-> rubirai


First, download the package using gem. In your Gemfile, add

gem 'rubirai'

Then, start to write code (no matter if it's a rails application or something else):

require 'rubirai'
# assuming your mirai http api address and port
# are and 8080
bot ='', '8080')
# qq and auth key
bot. 1145141919, 'ikisugi_key'

# Add a listener function
bot.add_listener do |event|
  puts event.inspect
  if event.is_a?(Rubirai::MessageEvent)
    event.respond("Hello, world!")

# Listen to message every 0.5 seconds
# And blocks the current thread
bot.start_listen 0.5, is_blocking: true

If you want to install globally with gem, use

gem install rubirai 

Wiki and Documentation


AGPL-3.0 License

FOSSA Status