A Discord bot to notify the match results of your Age of Empires 2: Definitive Edition community.
The goal of this project is to keep your community informed about your successes (and defeats) in Age of Empires 2 Definitive Edition by sending the results of your matches through Discord notifications.
Example:
The bot collects game data from World's Edge public API.
Software:
- python 3.7 or higher.
- Update the package lists:
$ apt update
- Install pip:
$ apt install -y python3-pip
- Install the project dependencies:
$ pip3 install requests pyyaml discord.py
- Create the installation directory:
$ mkdir /etc/aoe
- Put the sources inside:
$ ls -1 /etc/aoe/
aoe.py
main.py
- Edit the configuration file by filling your friends's Steam IDs and your Discord webhook:
$ cat /etc/aoe/config.yml
worldsedge_url: "https://aoe-api.worldsedgelink.com/community"
discord_hook: "https://discord.com/api/webhooks/your/token"
players:
- name: "TheViper"
steamId: "76561197984749679"
profileId: 196240
- name: "Hera"
steamId: "76561198449406083"
profileId: 199325
- Start the service:
$ python3.8 /etc/aoe/main.py --config-file="/etc/aoe/config.yml"
- Set un unit systemd daemon:
$ cat /etc/systemd/system/aoe.service
[Unit]
Description=aoe-notifier
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=python3 /etc/aoe/main.py --config-file="/etc/aoe/config.yml"
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
- Enable the service
$ systemctl daemon-reload
$ systemctl start aoe.service
- Check the logs
$ journalctl -u aoe.service -f