-
Clone this template:
git clone https://github.com/nessshon/aiogram-polling-template
-
Go to the project folder:
cd aiogram-polling-template
-
Create environment variables file:
cp .env.example .env
-
Configure environment variables file:
nano .env
-
Install requirements:
pip install -r requirements.txt
-
Run app:
python -m app
Variable | Type | Description | Example |
---|---|---|---|
BOT_TOKEN | str | Bot token, get it from @BotFather | 123456:qweRTY |
BOT_DEV_ID | int | User ID of the bot developer | 123456789 |
REDIS_HOST | str | The hostname or IP address of the Redis server | localhost |
REDIS_PORT | int | The port number on which the Redis server is running | 6379 |
REDIS_DB | int | The Redis database number | 1 |
DB_HOST | str | The hostname or IP address of the database server | localhost |
DB_PORT | int | The port number on which the database server is running | 3306 |
DB_USERNAME | str | The username for accessing the database | user |
DB_PASSWORD | str | The password for accessing the database | password |
DB_DATABASE | str | The name of the database | dbname |