β This bot is deprecated in favor of XBOP, a better written and optimized version of Boite Γ bois in Go language.
- π Features
- π² Requirements
- β© First start
- π§ Creating commands
- π Creating database models
- π Credits
- π License
- Play games many games, singleplayer or multiplayer
- Get the current weather and weather forecast for any city in the world
- Send very nice GIF
- Search for posts and users of our blog
- Ruby 2.1+
- A MongoDB database
- Discordrb gem
- JSON gem
- OpenWeatherMap gem
- Mongocore gem
To use it, you must setup config.json (there is example with the samples). When it's configured, you can start the bot with this command :
ruby run.rb
After that, the bot is ready and you can add it to your guild (Guide)
To create a new command, you only must create a file in /src/commands/ of the name of your command. In this file, you have to require command.rb and set the namespace to BoiteABois::Commands. The class should inherit from Command. When you add a new command, you must restart the bot. Here is an example :
require_relative 'command'
module BoiteABois
module Commands
class Example < Command
CATEGORY = 'default' # Command category, defined in the config
USAGE = 'example' # Command usage
DESC = 'Description' # Command description
#LISTEN = ['public', 'private'] # Listen for messages from public or private channel
#ALIAS = 'another_command' # Alias to another command
#SHOW = true # Visibility in the command list
#CHANNELS = [] # Array of authorized channels
#ROLES = [] # Array of authorized user roles
#MEMBERS = [] # Array of authorized members
def self.exec(args, context)
# context is an instance of Discordrb::Message
# args is an array of arguments
end
end
end
end
All the models are defined in two files :
lib/db/models
: the Ruby classlib/db/schemas
: the database schema, if required
The schemas are in the YML format. All is documented on the mongocore gem page
- Library : DiscordRB
- Developers :
- Nicolas Martinussen : first core
- ThΓ©o Vidal : maintainer, actual main developer