Skip to content
Discord bot for https://mod.io
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
migrations mod event subscriptions added Feb 25, 2019
src retrieve guild stats from serenity's cache May 25, 2019
.env.sample initial schema setup Feb 10, 2019
.gitignore initial schema setup Feb 10, 2019
Cargo.toml rework info field of the mod widget May 21, 2019
LICENSE-APACHE readme and license files Feb 7, 2019
LICENSE-MIT readme and license files Feb 7, 2019
README.md update invite to modbot server May 17, 2019
build.rs about command added Apr 3, 2019
diesel.toml initial schema setup Feb 10, 2019
logo.png

README.md

ModBot for Discord

Rust version Rust edition License Discord Invite ModBot

ModBot is a Discord bot for mod.io using modio-rs and serenity.

Example

Setup

You can invite the officially hosted ModBot to join your Discord server using the following URL https://discordbot.mod.io, or you can build and install your own version of ModBot by following the instructions below.

  1. Invite the ModBot https://discordbot.mod.io/
  2. View the games list ~games and set the default game ~game ID
  3. In the channel(s) you want the bot to post updates (mod added / edited), run the command ~subscribe ID
  4. Ensure the bot has Read Messages, Send Messages and Embed Links permissions in the channel(s) it is in to be able to function correctly

Commands

By default ~ is the prefix used to issue commands to ModBot. Once you have invited ModBot to your server, you can set the default game using the command ~game ID. Now when a user issues the command ~mods, all of the mods for the game you specified will be returned. You can change the default game at any time.

We recommend you also ~subscribe ID to games you are interested in receiving push notifications from. For example in our #bot channel, we have subscribed to a bunch of games and whenever a mod is updated, the channel is notified.

Popular commands include:

  • ~help show these commands
  • ~prefix CHARACTER change the default prefix from ~ to something else
  • ~game ID|Name set the default game
  • ~game return information about the default game
  • ~games return a list of all games
  • ~mod ID|Name return information about the mod(s) requested
  • ~mods return a list of all mods belonging to the default game
  • ~popular return a list of mods ordered by popularity
  • ~subscribe ID|Name subscribe to a game for updates (mods added/edited)
  • ~subscriptions see all games subscribed too
  • ~unsubscribe ID|Name unsubscribe from a game

Building

MODBOT is written in Rust, so you'll need to grab a Rust installation in order to compile it. Building is easy:

$ git clone https://github.com/nickelc/modio-bot
$ cd modio-bot
$ cargo build --release
$ ./target/release/modbot

Building with bundled sqlite3

Use the feature sqlite-bundled to compile sqlite3 from source and link against that.

$ cargo build --features sqlite-bundled

Installation

Cargo

$ cargo install --git https://github.com/nickelc/modio-bot
$ $HOME/.cargo/bin/modbot

Usage

Set up the environment variables with export or by creating a .env file.

  • DISCORD_BOT_TOKEN
  • MODIO_API_KEY or MODIO_TOKEN
  • MODIO_HOST (optional)

A .env sample is provided as .env.sample.

Running the bot

DISCORD_BOT_TOKEN="your token" \
MODIO_API_KEY="your api key" \
./path/to/modbot

Logging

Logging can be configured via environment variables.

RUST_LOG=modio=debug,modbot=debug

See the env_logger crate for more information.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You can’t perform that action at this time.