This a multipurpose Discord bot for various operations related to Sid Meier's Civilization V written in Go.
At its core the bot handles randomly assigning a group of players lists of civilizations to choose from for a multiplayer game; based on a number of possible configuration options.
Detailed instructions on all available commands are available by running the /civ help
command. Here's a summary of how to use the bot.
Players can enter the configuration flow by entering the /civ config
command in the channel where the bot is located. Configuration options are set by interacting with the reactions after each configuration option is presented.
Players can start a new session by entering the /civ new
command. Players join the game by reacting with the ✋ reaction. When all players are ready someone just needs to react with the ✅ reaction.
Depending on the current configuration each player gets to "ban" some number of civs, removing them from the pool of civs that the bot randomly chooses from. Users can enter bans with the /civ ban <arg>
providing either the civilization name, or leader name. The bot does a fuzzy match on the input and finds the closest matching civilization.
After all players have selected their bans the bot chooses a random set of civs for each player to choose from.
If the session is configured to allow for re-picks, and at least half the players react with ♻️ then, then the bot will randomly choose again.
Once the allotted number of repicks is reached, or the timer runs out then you're ready to pick a civ from your list and start playing!
-
make a discord application in the discord developer portal
-
create a bot for you application and set permissions
-
add the bot to your discord server
- go to the "OAuth2" tab, select scope "bot", navigate to the URL that gets generated
-
copy the bot token from the "Bot" tab and set the
CIV_BOT_TOKEN
environment variable
- make sure you have
go
installed by runninggo version
, you should see some output like/usr/local/bin/go
- clone the repository
cd
into the root directory- install dependencies with
go get github.com/ecshreve/civ-bot-go
- run the application with
make run
- now you can go to whatever channel you added the bot to in the previous section and interact with the bot, enter
/civ help
in the channel to see information about how to use the bot
Here's some links that I used as reference throughout the project:
repositories:
helpful golang links
helpful tooling links