Skip to content
This repository has been archived by the owner on Jan 9, 2021. It is now read-only.
/ boite-a-bois Public archive

πŸ€– BecauseOfProg's Discord bot

License

Notifications You must be signed in to change notification settings

BecauseOfProg/boite-a-bois

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

Boite Γ  bois

literally "box of wood"

Discord bot to play games and do other stuff

Website - Discord server - License

⚠ This bot is deprecated in favor of XBOP, a better written and optimized version of Boite à bois in Go language.

🌈 Features

  • 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

πŸ“² Requirements

⏩ First start

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)

πŸ”§ Creating commands

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

πŸ“š Creating database models

All the models are defined in two files :

  • lib/db/models : the Ruby class
  • lib/db/schemas : the database schema, if required

The schemas are in the YML format. All is documented on the mongocore gem page

πŸ“œ Credits

πŸ” License

GNU GPL v3