Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 1.3 KB

README.md

File metadata and controls

19 lines (16 loc) · 1.3 KB

Pet Pic Bot

The Telegram bot sends a picture with cat or dog using API.

The sources of pictures are: https://thecatapi.com/ and https://thedogapi.com/.

The logic

  1. User pushs one of the buttons from Telegram chat menu: 'kitty', 'doggy', 'kitty or doggy';
  2. Bot sends an appropriate picture in accordance with selected pet.

Installation

  1. clone the repository on your local directory by the command '$ git clone';
  2. create a virtual environment by the command python -m venv venv
  3. activate the virtual environment by the command source venv/Scripts/activate (for Windows) or by the command source venv/bin/activate (for Mac);
  4. upload the requirements from requirements.txt by the command pip install -r requirements.txt;
  5. get Telegram tocken follwed by the standard process (a message in Telegram to @BotFather and dialogue with it);
  6. create a file .env and put there the received Telegram tocken (in string format - 'XXX...XXX'), name this variable as TELEGRAM_TOKEN;
  7. launch bot by the command python pet_pic_bot.py;
  8. find your bot by the name received within registration on the step 5 above;
  9. select a pet using Telegram chat menu and enjoy the pictures.