Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 1.93 KB

README.md

File metadata and controls

72 lines (54 loc) · 1.93 KB

sili-telegram-bot 🚀

A telegram bot that evaluates DOTA2 matches of people and notifies about their results.

Local development 🏗️

Without docker ⚙️

Change the two variables bot_token and chat_id in bot.py accordingly. Instead of using inline environment variables you can use a .env file in VSCode.

For Linux 🐧

pip install .
bot_token="<bot_token>" chat_id="<chat_id>" run_bot

For Windows 💩

pip install .
cd src
set bot_token="<bot_token>"
set chat_id="<chat_id>"
run_bot

With docker 🐋

docker rm sili-bot
docker build -t sili-bot --build-arg bot_token="<BOT_TOKEN>" --build-arg chat_id="<CHAT_ID>" .
docker run --name sili-bot sili-bot

Or, if the secrets are already contained in config.json:

docker rm sili-bot
docker build -t sili-bot .
docker run --name sili-bot sili-bot

By default, the container incorporates the state of resources/dynamic at build time, but does not have persistence. As a consequence, the bot might re-send match summaries after a restart. To mitigate this, use a volume for the dynamic resources. This decouples the containers state from the build repo's and adds persistence:

docker run --mount source=silibotvolume,target=/bot/resources/dynamic --name sili-bot -d sili-bot

WIP: Port to Rust

Inline mode

The bot has the capability for inline response search (see https://core.telegram.org/bots/inline for more information). To enable this, send /setinline to the botfather and, when prompred, set the placeholder message along the lines of "Search for responses...".