Package: discord-fate-bot
Discord Fate BotADiscordbot to help play theFate roleplaying game.CommandsOnce Discord Fate Bot is invited to a server, it will listen in text channels
for commands and reply. All commands start with!.!rollRoll four Fate dice, with modifiers, optionally against a static opposition.
This command has the following forms.!roll— Simply roll four Fate dice and see the result!roll [+|-]MOD...— Roll with a modifier. The+or-is required.
Multiple modifiers may be given, separated by spaces.Example:!roll +5 -2to roll with an effective +3 modifier.!roll MODIFIERS vs OPPOSITION— Roll against a static opposition
amount. The result will be one of: fail, tie, succeed, or succeed with style.Example:!roll +2 vs 3!sceneStart a scene in the current channel. Each channel can have one scene active,
which can be used to track situation aspects. The message describing the
current scene will automatically be pinned (and unpinned when the scene ends).!scene [DESCRIPTION]— Start a new scene in the current channel. The
entire rest of the message will be used as the description. If a scene is
already active, it will be ended automatically.Example:!scene Warehouse Five!scene end— End the current scene.!aspectAdd or manage aspects in the current scene. There must be an active scene in
the current channel to use these commands. Aspects are automatically added to
the pinned scene message.Every aspect is given an ID — a unique number within the scene —
which is used to refer to the aspect after creation (for example, to remove
it).!aspect [TAGS]... NAME— Add a new aspect to the current scene.
Tags may be included, separated by spaces. After tags, the rest of the line
will be used the aspect name.boost— Tag this aspect as a boost, which means it automatically
disappears when it runs out of invokes.TODO:A boost should
implicitly add one free invoke if theinvokestag is not specified.invokes=COUNT— Tag this aspect with some number of free
invokes attached.Example:!aspect Darkness of nightExample:!aspect boost invokes=2 Really awesome aspect name!aspect remove ID...— Remove one or more aspects from the scene.!aspect modify ID NAME— Rename an existing aspect. The rest of the
line will be used as the new aspect name.TODO:It will eventually be possible to update tags as well.TODO:!aspect invoke ID— Decrease the number of remaining free
invokes for the specified aspect.Future CommandsI plan to add commands to manage a turn order, and possibly to track fate
points. Beyond that, I may add facilities to track PCs and NPCs, though Discord
text channels may not be the most convenient interface to manage those.Inviting the BotThere isn't currently a public instance of Discord Fate Bot available for
invite. If you host your own copy, the bot will log an invite URL when it
connects to Discord. Currently, the bot will ask for the following Discord
permissions.Add reactionsTo leave a :+1: once it has processed a message.Manage messagesTo pin and unpin the scene message.Read message historyNot currently used, but I have a half-thought that there could be a
feature to recover scenes from message history if the database is
out-of-sync with the channel.Read messagesTo read commands.Send messagesTo reply with results.This list may grow and change while the bot is in development, but I'll try to
freeze it once I release a stable public version.InstallingThis section is out-of-date since I've started bulding a Docker App.Please bear with me while I work out the bugs with that, and then I'll update
this section.Discord Fate Bot is availableon Docker Hub. Images are
automatically built and published based on ourDockerfile. There is also adocker-compose.ymlfile to deploy the app in Docker Swarm as a Stack,
including a Mongo DB service.Installing in Docker Swarm as a StackTo install as a Stack, simply deploy ourdocker-compose.ymlfile. To install
without having to check anything out, you can pipe it directly from GitHub.$ curl https://raw.githubusercontent.com/chrisbouchard/discord-fate-bot/master/docker-compose.yml | \
      docker stack deploy --compose-file - discord-fate-botInstalling from PyPIDiscord Fate Bot is also availableon PyPI.$ pip install discord-fate-bot
$ discord-fate-botMake sure to configure your environment variables to hook up to Discord and
your Mongo database (see below).Installing from SourceI don't necessarily recommend this for production, but you can check out the
project locally and install in a virtual environment.Make sure you have at least Python 3.7 installed. You'll also need toinstall Poetry, which we use for dependency management
and packaging.$ git checkout https://github.com/chrisbouchard/discord-fate-bot.git
$ cd discord-fate-bot
$ poetry install
$ poetry run discord-fate-botMake sure to configure your environment variables to hook up to Discord and
your Mongo database (see below).ConfiguringDiscord Fate Bot looks for the following environment variables on start-up.DFB_BOT_TOKEN— The Discord authentication token for the bot account.Mutually exclusive withDFB_BOT_TOKEN_FILE.DFB_BOT_TOKEN_FILE— The path to a filecontainingthe
authentication token.Mutually exclusive withDFB_BOT_TOKEN.DFB_LOG_CONFIG_FILE—(Optional)The path to a Python log config
file. See thePython documentationfor a description
of the file format.DFB_MONGO_CONNECTION_URL— The MongoDB connection URL.DFB_MONGO_PASSWORD— The password for the Mongo DB connection.Mutually exclusive withDFB_MONGO_PASSWORD_FILE.DFB_MONGO_PASSWORD_FILE— The path to a filecontainingthe
password for the Mongo DB connection.Mutually exclusive withDFB_MONGO_PASSWORD.Note:For variables that have a*_FILEpair, the direct version is
provided as a convenience, e.g., for development. I subscribe to the school of
thought that it's best not to store production secrets in environment variables
if at all avoidable. Our Docker Stack definition uses Secrets to share the
Discord token and Mongo password into the services.ArchitectureDiscord Fate Bot is written in Python, mostly based on the awesomeDiscord.pylibrary. We useMongoDBfor long-term
storage when necessary (e.g., for scenes and aspects).