Git Product home page Git Product logo

einrain-rs's Introduction

Einrain-rs: A Discord Bot for Blue Protocol

Einrain is a Discord bot made for the game Blue Protocol and the Blue Protocol Database's Discord server. Although it's still in its infancy, we hope it will come to be an invaluable tool for players of Blue Protocol.

einrain-rs_preview.mp4

Features

  • Slash Commands
  • /class <class_type>: Returns all information associated with the selected class
  • /skills <class_type>: Returns all skills of the selected class
  • /help <command>: Returns information on the given command or all commands
  • ~register <global>: Registers slash commands with the guild or global (Owner only)
  • ~unregister <global>: Unregisters slash commands with the guild or global (Owner only)
  • Logging
  • Class information stored in an easy to modify JSON format and serialized at compile time
  • Modularized command structure

Setup

If you haven't already, install Rust and Cargo with rustup.

Clone or download this repo.

Create a config.toml file in the root of the bot's directory, formatted like

token = '<bot token here>' # Token for the Discord bot
owner_id = <bot owners id here> # Discord ID of bot owner for registering and unregistering slash commands
log_file = 'log.txt' # Unused
colour = 12345678 # Unused

Create a Discord Bot Application here. Go to the "Bot" tab on the left. Copy and paste the bot's token into your config.toml as indicated above.

Find the Discord user you want to designate as the "owner". This is the user who will be able to register slash commands with Discord after the bot is running and in a server. Right click on their username and click "Copy ID". Copy and paste the owner's id into your config.toml as indicated above.

Go back to the root of the bot's directory, set the RUST_LOG environement variable to info or preferred to activate logging, and execute the following command to run the bot normally:

cargo run --release

Go back to the Discord Bot Application website and the "OAuth2" tab. Select the scope "bot" in the URL Generator and copy the URL at the bottom. Go to the URL and add the bot to the server you want.

If you go to the server and attempt to execute a slash command at this point, you won't be able to. Slash commands must be registered with Discord before they are able to be used. The owner must enter the server with the bot and execute ~register. Commands should then be available in the slash commands menu soon, if they aren't already. Tip: Slash commands can be accessed by typing "/" into chat.

All done!

Running with Docker

First we compile the bot and build the Docker container by executing:

docker build -t einrain .

To run it, we execute:

docker run -it --rm --name einrain-running einrain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.