Skip to content

RetroRealm/RetroBot

Repository files navigation

RetroBot

Official Discord bot for RetroRealm. Exposes Playmatch as Discord slash commands so users can identify ROMs, browse matched companies and platforms, and submit metadata suggestions without leaving Discord.

Every response is rendered with Discord's Components V2 (top-level Container, TextDisplay, Separator, ActionRow). No classic embeds.

Features

Supported

  • /list companies and /list platforms with paginated tables
  • /get game <hashes|name+size> for a full Playmatch metadata card (matched platform, company, ROM files, DAT file, provider mappings)
  • /suggest game|company|platform with owner approval buttons and an outcome DM back to the submitter
  • /match game|company|platform for manual metadata matching, restricted to bot owners and trusted roles
  • /toggle_update role toggle for the RetroRealm guild
  • /ping and a custom /help
  • Components V2 flag (IS_COMPONENTS_V2) on every outgoing message

Planned

  • Pin serenity and poise back to released crates.io versions once a Components V2 release ships
  • Expose further Playmatch endpoints as commands as they stabilise

Getting Started

Prerequisites

  1. Rust 1.95+ from here
  2. A Discord bot token. Create an application at the Discord Developer Portal, enable a Bot user, and use the applications.commands scope when inviting it
  3. Access to a Playmatch instance. The public one at playmatch.retrorealm.dev works, or self-host from RetroRealm/playmatch

Development

  1. Clone the repository
  2. Create a .env in the repository root with the variables below
  3. Run cargo run (debug) or cargo run --release

Environment variables

Variable Required Purpose
DISCORD_TOKEN yes Bot token from the Discord Developer Portal
PLAYMATCH_API_AUTH yes Bearer token for the Playmatch API
PLAYMATCH_API_URL no Playmatch base URL, defaults to https://playmatch.retrorealm.dev
DISCORD_STATUS no Activity kind (playing, listening, watching, competing)
DISCORD_STATUS_NAME no Activity text shown next to the kind
DISCORD_RETROREALM_SERVER_ID for guild commands Guild id used when registering guild-scoped commands
DISCORD_RETROREALM_STAFF_ROLE_ID no Role id that bypasses trusted-role checks
DISCORD_TRUSTED_ROLE_IDS no Comma-separated role ids allowed to run /match
DISCORD_RETROREALM_UPDATE_ROLE_ID no Role id toggled by /toggle_update
DISCORD_RETROREALM_SUGGESTION_CHANNEL_ID no Channel id where suggestion review cards are posted

Deployment

Docker images are available here at ghcr.io/retrorealm/retrobot.

Built With

  • Rust - the programming language used
  • tokio - async runtime
  • serenity - Discord API client (next branch, for Components V2)
  • poise - command framework on top of serenity (serenity-next branch)
  • reqwest - HTTP client
  • progenitor - generator for the in-tree playmatch_client crate

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

Official RetroRealm Discord Bot

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages