Metadata-Version: 2.4
Name: aoe2_telegram_bot
Version: 0.3.0
Summary: A Telegram Bot that gives a random quote of Age of Empires 2 original edition
Author-email: Perceval ARENOU <perceval.arenou@gmail.com>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Games/Entertainment
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: OS Independent
Classifier: Environment :: No Input/Output (Daemon)
Classifier: Natural Language :: English
Classifier: Natural Language :: French
License-File: LICENSE
Requires-Dist: python-telegram-bot>=v20.0
Requires-Dist: requests>=2.31.0
Requires-Dist: pytest>=7.4.0 ; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0 ; extra == "test"
Requires-Dist: pytest-cov>=4.1.0 ; extra == "test"
Requires-Dist: pytest-mock>=3.11.0 ; extra == "test"
Project-URL: Homepage, https://github.com/PercevalSA/aoe2-telegram-bot
Project-URL: Issues, https://github.com/PercevalSA/aoe2-telegram-bot/issues
Provides-Extra: test

# aoe2-telegram-bot

Age Of Empires II Telegram Bot: give a random quote of Age of Empires 2 original edition

[Contact the bot on telegram](https://web.telegram.org/k/#@age_of_empires_2_bot)

## Installation

Install python package from PyPI

```bash
python3 -m pip install aoe2-telegram-bot
```

Or from source

```bash
git clone https://github.com/PercevalSA/aoe2-telegram-bot
cd aoe2-telegram-bot
python3 -m pip install .
```

Set an environment file with your telegram bot token as `TGB_TOKEN`

```bash
mkdir -p $HOME/.config/aoe2-telegram-bot
echo 'TGB_TOKEN=xxxx' >$HOME/.config/aoe2-telegram-bot/env
```

## running

When started for the first time the bot will download sounds from internet and store them in the package folder.
When you start the bot manually you will need to export the token as environment variable or set it in the environment file in `$HOME/.config/aoe2-telegram-bot/env`

```bash
export TGB_TOKEN=xxxx
``` 

or create config directory and add token


```bash
mkdir -p ~/.config/aoe2-telegram-bot
echo 'TGB_TOKEN=your_token_here' > ~/.config/aoe2-telegram-bot/env
```

Then just run
```bash
aoe2-telegram-bot
```

### Configuration Options

You can configure the bot using environment variables:

- `TGB_TOKEN` - Your Telegram bot token (required)
- `LOG_LEVEL` - Logging level: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` (default: `INFO`)

Example with custom log level:
```bash
export TGB_TOKEN=your_token_here
export LOG_LEVEL=DEBUG
aoe2-telegram-bot
```

## Running as a Service

If you need the bot to run as a service you can use the provided systemd service file generated by the bootstrap command

```bash
aoe2-telegram-bot-bootstrap
sudo cp aoe2-telegram-bot.service /etc/systemd/system/aoe2-telegram-bot.service
sudo systemctl daemon-reload
sudo systemctl enable aoe2-telegram-bot
sudo systemctl start aoe2-telegram-bot
```

## Installed sounds

* `taunt.zip` are french taunt in `mp3` format. There are 42 taunts in total.
  * their name are composed of a 2 padded number (like 02 or 15), a space and the name
* `civilization.zip` are all specific civilization start sounds in `mp3` format
  * their name is a single word starting with a capital letter
* `sound.zip` are all in game sounds (building, generic units...) in `wav` format
  * their name is full lowercase and can have a number only at the end (e.g. multiples sounds for the same thing)

## How to get sounds

to get sound checks your steam files in `$HOME/.steam/steam/steamapps/common/AoE2DE/wwise/` and get `pck` files.

Get the softwares

You need to extract .pck that contains .bnk files that contain wem files that you need to convert to wav or ogg.

* [extract pck](https://www.scampers.org/steve/sms/other.htm#ravioli_download) but is windows only
* [extract bnk](https://github.com/hcs64/vgm_ripping) or [this updated one](https://github.com/eXpl0it3r/bnkextr/tree/master)
* [convert ww to ogg](https://github.com/hcs64/ww2ogg)

If you build `wwisexmabank` or `xmash` on mondern Linux add `$(CC) $^ -o $@ $(LDFLAGS)` on line 10 in `Makefile.common`

