Skip to content

The bot sends a nice picture of cat or dog using API.

Notifications You must be signed in to change notification settings

r-krasovskiy/pet-pic-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

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.

About

The bot sends a nice picture of cat or dog using API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages