HammerBot is a discord bot built for an Age of Empire II streamer's discord server. HammerBot features Age of Empires II specific commands, such as !whichciv <techName>
which returns a list of civs that get that specific technology in-game.
Specific features include:
- Team civilization randomizer for 2v2s, 3v3s, and 4v4s that takes into account pocket or flank positions
- Finding out if a civilization has a specific technology or unit
- Returning in-game taunts
- Player rank and match commands with info pulled from the aoe2.net API
- And more!
HammerBot is built with Discord.py, an API wrapper for Discord.
Other packages/libraries used include:
- asyncio
- aiohttp
HammerBot currently has a very simple setup, where all features are split into their own cogs.
If a bug or any unintended behavior is discovered, please report it by creating an issue here.
If you'd like to contribute code to HammerBot, please:
- Follow the setup guidelines & fork the repository
- Make any contributions in your fork
- Create a pull request
Your pull request will then be reviewed. Please read the Contributing Guidelines before creating your first pull request.
- Get a Discord bot token by going to the Discord Developers website (you'll have to login)
- Create an Application & click
Bot
in the left sidebar - Create a bot - the name you put will be seen in the servers
- Copy the token from this page and hold onto it
- Click
OAuth2
from the left sidebar - Under
Scopes
, checkbot
- In
Bot Permissions
selectadministrator
underGeneral Permissions
- Copy the link from the
Scopes
section and open it in a new tab - Select the server you want to add the bot to
- Fork this repository
git clone
HammerBot, andcd
into theHammerBot
directory- Make a new file called
.env
and fill in the fields based off the.env.example
file
- Setup venv with
pip3 install virtualenv
(mac/linux) orpy -m pip install --user virtualenv
(windows) - Then run
virtualenv venv
(mac/linux) orpy -m venv venv
(windows) - Enter the virtual environment with
source venv/bin/activate
(mac/linux) or.\venv\Scripts\activate
(windows) - Then let pip get the latest libraries with
pip3 install -r requirements.txt
(mac/linux) orpy -m pip install -r requirements
(windows) - Then test run your HammerBot with
python3 -m hammerbot.py
(mac/linux) orpy -m hammerbot.py
(windows) in the main directory - The bot should show up in your server and respond to commands such as
11