The user sends the /start
command to the bot (or starts it by searching for it).
The bot greets the user, informs the user that the user can read the book directly in the chat with the bot, and prompts the user to see the list of available commands by sending the /help
command.
At this point, the user can perform 5 actions:
- Send a chat command /help
- Send into chat the command /beginning
- Send into chat the command /continue
- Send command /bookmarks into chat
- Send any other message to the chat room
Command /help
.
The user sends the command /help
into the chat room. The bot sends the user a list of available commands, tells them they can save pages of the book as bookmarks, and wishes them a pleasant reading experience.
Command /beginning
.
The user sends the chat command /beginning
. The bot sends the chat the first page of the book and 3 inline buttons (back, current page number and forward).
-
Press the "Forward" button and then the bot will load the next page of the book if the current page is not the last page. The current page number on the button will increase by 1. And if the current page is the last page in the book, nothing will change.
-
Press on the button with the current page number and then the bot will save that page to bookmarks, letting the user know.
-
Press on the "Back" button and then the bot will load the previous page of the book if the current page is not the first page. The current page number on the button will decrease by 1. And if the current page is the first page, nothing will change
Command /continue
.
The user sends the /continue
command to the bot. The bot sends to the chat the page of the book where the user stopped reading during the last interaction with the message-book. If the user has not yet started reading the book - the bot sends a message with the first page of the book.
Command /bookmarks
.
User sends chat command /bookmarks. If the user has saved bookmarks before, the bot sends a list of saved bookmarks to the chat as inline buttons, as well as inline "Edit" and "Cancel" buttons.
- Download the repository with the bot
- Install all the necessary dependencies by running the
pip install -r requirements.txt
command - Create a bot in Telegram and get its API token in the config.py file
- Replace the value of the
BOT_TOKEN
variable with the obtained API token - Run the bot by running the
python main.py
command