Skip to content

photometer/homework_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homework Bot

Bot for checking the status of homework for code review in Yandex.Practicum

This bot uses Yandex.Practicum API data. Works both on PC and Heroku, just run the bot with valid tokens. Every 10 minutes bot checks the Yandex.Practicum API and sends the status to telegram account. If the work is reviewed you will receive a message about the status (if there are changes) of your code review.

The Practicum.Homework API has only one endpoint and access to it possible only by token.

You can get the token here. Copy it. Later it will come in handy.

How this API works

When reviewer checks your homework, its status changes:

  • homework submitted for review
  • homework returned for bug fixes
  • homework is accepted

If the program detects a status change during the next check (once per 10 minutes), the updated status is sent by the bot to the specified chat.

Launch on PC

  • You can clone this project: git clone https://github.com/photometer/homework_bot

  • In this project folder create and activate virtual environment (recommendations for Windows):

    python -m venv venv
    . venv/scripts/activate
    
  • In venv install all necessary requirements:

    pip install -r requirements.txt
  • Import tokens for Yandex.Practicum and Telegram in console:

    export PRACTICUM_TOKEN=<PRACTICUM_TOKEN>
    export TELEGRAM_TOKEN=<TELEGRAM_TOKEN>
    export CHAT_ID=<CHAT_ID>

    NOTE: TELEGRAM_TOKEN is the token given you by @BotFather, CHAT_ID is the id of chat recipient of the status (can be obtained from @userinfobot)

  • Start the program:

    python homework.py

Автор: Elizaveta Androsova 💥

About

Bot for checking homework status in Yandex.Practicum

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published