discorb is a Discord API wrapper for Ruby.
Installation
Add this line to your application's Gemfile:
gem 'discorb'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install discorb
Usage
Simple ping-pong
require "discorb"
client = Discorb::Client.new
client.once :standby do
puts "Logged in as #{client.user}"
end
client.on :message do ||
next if ..bot?
next unless .content == "ping"
.channel.post("Pong!")
end
client.run(ENV["DISCORD_BOT_TOKEN"])
Contributing
Bug reports and pull requests are welcome on GitHub at github.com/discorb-lib/discorb.
License
The gem is available as open source under the terms of the MIT License.