This bot is built using the python-telegram-bot
library and provides three commands: Flip
, Stats
and About
.
The Flip
command is intended for flipping a coin. The bot simulates a random coin toss and responds with the result - "Heads" or "Tails".
The Stats
command displays coin toss statistics for each user. The bot tracks the number of flips and results for each user.
The About
command displays information about the bot.
- Clone the repository:
git clone https://github.com/Olderestin/coin-flip-telegram-bot.git
- Navigate to the project directory:
cd coin-flip-telegram-bot
- Create virtual environment:
python -m venv venv
- Activate venv:
venv\Scripts\activate
- Install pip:
python -m pip install --upgrade pip
- Install dependencies:
pip install -r requirements.txt
- Create a .env file based on the provided example (don't forget to insert the token there):
cd src cp .env.example .env
- Run the bot:
python main.py
- Clone the repository:
git clone https://github.com/Olderestin/coin-flip-telegram-bot.git
- Navigate to the project directory:
cd coin-flip-telegram-bot/src
- Create a .env file based on the provided example (don't forget to insert the token there):
cp .env.example .env
- Run bot with docker:
cd .. docker compose up
- sqlite3 database is used to save usage statistics. Database folder
src/storage