Skip to content

Mihail-1212/test-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python 3 Aiogram Telebot

This is test telegram chatbot.

It have next commands:

/start - Start conversation
/weather - Get weather from input place
/currencyconversion - Convert currency
/randomanimal - Get random picture of animal
/createsendpolls - Create polls and send to chat

Used:

  • Python (v 3.8.1)
  • pip (v 19.2.3)
  • Aiogram (v 2.25)
  • pyowm (library for openweather api)
  • animals.py (library for some-random-api)

Used apis:

Quick start

Install pip libs:

pip install -r requirements.txt

Create .env file with api tokens inside (see .env.example).

Available .env vars:

  • POLLING_SKIP_UPDATES (opt) - bool variable to skip all bot updates before start polling
  • TELEBOT_API_TOKEN (req) - api token for telegram bot
  • WEATHER_API_KEY (req) - api token for OpenWeatherApi (https://openweathermap.org/)
  • CURRENCY_CONVERSION_API_TOKEN (req) - api token for ExchangeRatesApi (https://exchangeratesapi.io/)

Then start application:

python main.py

Application structure:

.
├── telebot                     # Application src directory
│   ├── commands                    # Directory with bot commands instances
│   ├── handlers                    # Directory with bot handlers (commands, etc)
│   ├── keyboards                   # Directory with keyboard instance creation funcs
│   ├── models                      # Directory with used models
│   ├── services                    # Directory with app services
│   ├── middleware.py               # File with cusom middlewares
│   └── sturtup_handlers.py         # File with start polling handlers inside
├── config.py                   # File contain constraints to use in app
├── main.py                     # Main file of application
├── .env                        # File within environment variables
├── requirements.txt            # Text requirements file within pip freeze modules
└── README.md                   

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages