Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
/ eu4img Public archive

A Discord bot for the video game EU4 that creates in-channel post-game reports, organizes game reservations, etc.

License

Notifications You must be signed in to change notification settings

2kai2kai2/eu4img

Repository files navigation

Warning

This version is not longer supported

I have a new version of the The Cartographer here, written in rust and supporting modern versions of Discord (if you previously had the bot in your server, it will be using the new version now).


Deployment State Code Size Total Size License GPL-3.0 Vulnerabilities

The Cartographer

This bot is a must-have for Discord servers that play the video game Europa Universalis IV (EU4) by Paradox Interactive.

While primarily intended for multiplayer campaigns, The Cartographer fully supports all applicable features for singleplayer.

Features:

1) Beautiful Post-Game AAR Stats

Similar to the popular tool Skanderbeg, The Cartographer provides statistics and a map showing information about an uploaded game save file. However, The Cartographer is unique in that it posts an aesthetically fitting image containing this information directly into the Discord channel.

To get started, simply type /stats in the channel where you want the display to be posted. There is an optional skanderbeg option which, if enabled, will automatically upload to Skanderbeg and post the link alongside the in-channel stats display.

The Cartographer will send you a direct message with instructions on how to upload the file and optionally modify the list of players to be displayed.

Stats Example

Map shows player borders including subject states. And yes, I am the one playing the unnecessarily wealthy Russia that has seized London, Tehran, and Beijing. For the record, colonialism and imperalism are bad IRL.

2) Managing Multiplayer Campaign Reservations

Easy commands to set up a channel for reservations. Simply set up a fresh channel for reservations and type /reservations

  • Avoid duplicates picks and conflicts: It's first-come, first serve (with admin overrides, of course)!
  • Automatically inform users when they've selected a banned nation.
  • Automatically delete messages to the channel that could push the reservation list up.
  • An image showing the picked nations, making it easier to find one you want to play that's open.
  • Most importantly, keep everything organized!

Reservations


How can I add this to my Discord server?

While we do not currently have a link to add the bot publically available, but you can request a link on The Cartographer Official Discord Server

Discord Button

Running Your Own Bot Instance

If you would prefer to run your own instance of the bot, you can. (If you're not sure, feel free to join the Discord server with the above link and ask!)

Depending on your system or hosting service, you may have different ways of running the program. However, there are a few things that are important:

1. Environment Variables

Either in your environment variables or in the .env file, provide the following:

Environment Variable Description
DISCORD_TOKEN A Discord bot token from the Discord Developer Portal.
SKANDERBEG_TOKEN (optional) A Skanderbeg API token for automatic Skanderbeg uploads.
MONGODB_USERNAME Username to access a MongoDB cluster where the bot will store its data.
MONGODB_PASSWORD Password to access a MongoDB cluster where the bot will store its data.
MONGODB_CLUSTERURL Cluster URL to access a MongoDB cluster where the bot will store its data.

A template can be found in the file template.env; simply rename to .env and modify.

2. Install Dependencies

The recommended method for running the bot is in a Docker Container. A Dockerfile is provided which will load the necessary dependencies.

If you decide not to use Docker, you can still install dependencies manually:

pip install -r requirements.txt

3. Run

If you choose to run the bot in a Docker Container, the command to start is already setup in Dockerfile.

If you decide not to use Docker, the following are example commands for starting up the bot:

Linux:

python3 EU4Bot.py

Windows:

python EU4Bot.py

However, many hosting services or different platforms may have different methods for running Python 3.x programs.


Updates

Updated game data will be needed when a new EU4 version is released. I will do my best to this as soon as possible after new game updates are released, but private bot instances will need to update from the GitHub repo.