/dominions-5-status

A discord bot to provide utilities for players of Dominions 5. Notify on turns, show status, track players, form lobbies.

Primary LanguageRustMIT LicenseMIT

CircleCI

Dominions 5 Discord Bot

A discord bot containing utilities for dominions 5

Thanks to https://github.com/culka/dom4status and http://www.cs.helsinki.fi/u/aitakang/dom3_serverformat_notes

Usage:

To run natively with Rust:

To run in docker:

  • Follow the first 3 steps about setting up the bot
  • Make a folder on the host called "resources" containing the token file as before. This is also where the db file will be created.
  • Run the command: docker run -it -d --restart unless-stopped -v /home/dmcgill9071/dom-5-bot/resources:/usr/src/myapp/resources --log-opt max-size=10m --log-opt max-file=5 eu.gcr.io/dom-5-status/dom-5-status except replace /home/dmcgill9071/dom-5-bot/resources with the location of your resource folder.

Slash commands:

Note that this bot now supports discord's slash commands which look like: image

To do this, you need to also put a file in the resources folder called "application" containing the discord application's ID. Note that currently only "guild" i.e. server commands are supported, and not "global" commands, which I think would allow their use in the bot's DMs. All commands using "!" work as before.

Commands:

n.b. server alias is optional, defaults to channel name. <> means an argument, [] means optional

  • !add <address:port> [<alias>]:
    • save the dom5 server address
  • !list:
    • return a list of the saved server addresses and aliases
  • !delete [<alias>]:
    • remove the server address from the list
  • !details [<alias>]:
    • return a list of the nations and their statuses in the game
  • !register nation_prefix [<alias>]:
    • register yourself as a nation in a game. Tries to ignore case, punctuation etc.
  • !register-id nation_id [<alias>]:
    • register yourself as a nation in a game using the id
  • !unregister [<alias>]:
    • unregister yourself in a game
  • !turns:
    • show all of the games you're in and their turn status
  • !notifications {true, false}:
    • enable/disable turn notifications for you. Enabled by default.
  • !lobby {EA/MA/LA} <num_players> [<alias>]:
    • create a lobby with no server
  • !lobbies:
    • list available lobbies
  • !{item, spell, unit, site, merc, event} <text>:
    • get dom5inspector search url
  • !start <address:port> [<alias>]:
    • register a started server for a lobby game
  • !describe "text" [<alias>]:
    • add a description to a lobby. Quotes required to avoid issues with spaces.
  • !unstart [<alias>]:
    • turn a game back into a lobby, if you need to change address
  • !help:
    • display this text

##TODO:

  • more unit tests
  • permissions for commands
  • more embed responses
  • db queries contain named arguments
  • BUG: possibly crash happens when turns and details happen at the same time? https://i.imgur.com/FioCpvD.png

##MAYBE:

  • easier nation selection - acronyms, nicknames, fuzzy search, etc
  • edit pinned post instead of new
  • register channel for notifications
  • have docker volume/cache the crate registry (speed up builds)
  • bot create game channels
  • bot post samogging/stalls/deaths/ais in the channel with the same name as the alias