Generate digests for your Tg-channel in several seconds!
View Demo
·
Report Bug
·
Request Feature
Table of Contents
During the Software Project course in Innopolis University Team 49 has collaborated with customer Gleb Shalimov to create a Digest Telegram Bot that generates digests of channel posts using LLM.
Key features 🌟:
- Digest period (week, 2 weeks, month, custom)
- Channel selection
- Main digest language (Ru/Eng)
- Second digest language (Ru/Eng/none)
- Publish to the channel
- Bot language (Ru/Eng)
- Choice between YaGPT and 01-ai/Yi-1.5-34B-Chat models
The DigestTelegramBot was built using:
Follow these simple steps to get a local copy and run it on your machine! 📦
- Python 3.10 or higher;
- Telegram account;
- git installed;
- pip (Python package installer) installed.
- Bot created in @BotFather.
Copy and paste it to your terminal.
- Clone the repo.
git clone https://gitlab.pg.innopolis.university/i.ershov/digestBot.git
- Create a virtual inviroment.
python3 -m venv venv
- Activate the virtual environment.
- For Windows:
venv\Scripts\activate
- For macOS and Linux:
source venv/bin/activate
- Install the required packages.
pip install -r requirements.txt
- Configure environment variables
Create a .env file in the project root directory and add your Telegram bot token (is given in a message after creation by @BotFather):
BOT_TOKEN=your_telegram_bot_token
To run the bot:
- Download the Docker Desktop;
- Write to console:
docker build -t digest:latest --platform linux/amd64 .
docker compose down
docker compose up
docker logs digestbot-digest-bot-service-1 --follow
- Set up a bot
- Create the landing message for the bot
- Make the bot read messages
- Integrate LLM
- Make the bot send summaries to the channel
- Configure and deploy the server for the bot operations
- Implement Button Instructions for Enhanced Telegram Bot UX
- Implement Databases for Telegram channels
- Create Telegram channels and start Testing
- Implement Databases for Telegram channels
- Implement secure bot admin verification
- Set up inviroment variables
- Design database for channel posts
- Implement customisable settings
- Customise interface language
- Russian
- English
- Others
- Enable option to add personal LLM API Key
- Configure language of posts in the channel
- Add variety of digests periods
- Add second language in digest
- Add preview text for the digest
- Deploy the new version
- Add automatic digest publishing
- Switch to free LLM 01-ai/Yi-1.5-34B-Chat
- Add ability of user to change prompt
- Implement monetization
- Create donate button
See the open issues for a full list of proposed features (and known issues).
- Fork the repository (click the "Fork" button in the upper-right corner of the repository page.)
- Create a new branch.
git checkout -b feature/your-feature-name
- Stash files with changes.
- Some files:
git add path/to/your/file1.py path/to/your/file2.py
- All files:
git add .
- Commit staged files.
git commit -m 'Add some feature'
- Push to the branch.
git push origin feature/your-feature-name
- Open a pull request (In repository page: Merge Requests -> New merge request, select Source branch with changes, select Target branch to apply changes on, review changes, provide title and detailed description.)
- Ivan Ershov - bot architect, project administrator, software engineer, techical support, contributor;
- Timur Salakhov - bot architect, database engineer, quality assurance engineer, contributor;
- Lana Ermolaeva - technical writer, prototype designer, contributor;
- Anastasia Mitiutneva - team coordinator, technical writer, prompt engineer, contributor;
- Ivan Makarov - videographer, tester, contributor;
- Anastasia Surikova - architectural documenter, tester, contributor.
Step-by-step instruction of how to use the DigestTelegramBot 👇:
- Add bot as an admin to your channel:
- Go to your Telegram channel Info;
- Click on "Administrators";
- Click on "Add Admin";
- Select DigestBot (@DigestTelegrambot);
- Allow the bot to "Manage Messages";
- Click "Done".
- Publish posts;
- Go to DigestBot (@DigestTelegrambot);
- Set up the languages in digest::
- Click on "⚙️Settings"
- Select channel for digest;
- Select "🌍Main language" to view or change the first language in digest (Ru/Eng);
- Click "⬅️Back" after selection is done to return to language preferences;
- Select "🌎Additional language" to view or change the second language in digest (Ru/Eng/without);
- Click "⬅️Back" after selection is done to return to language preferences;
- Click "⬅️Back" to return to the main keyboard.
- Create digest:
- Click "✍🏼Create digest";
- Click on one name of your channeles available (if none are displayed, you need to go throught guide steps 1 and 2);
- Click on one of the digest periods available or click on "Custom period" and send the number of days.
- Work with generated digest:
- Click "✅Approve" to sent the digest to your channel;
- Click "✏️Edit" to edit and pubslish the final version:
- Copy the digest;
- Rewrite parts;
- Send the final version as a message in the bot chat;
- Click "✅Approve" to sent the digest to your channel.
- Click "🔄Regenerate" to get the alternative digest;
- Click "❌Cancel" to return to the main keyboard.
-
The bot is stuck/digest is not generating:
- Check the internet connection;
- Check the Telegram problems;
If there are no problems with that, write and send
/start
to restart the bot. -
No channels are available for selection:
- Check the internet connection;
- Check the Telegram problems;
- Check that the bot is an admin of the channel and is allowed to read messages.
🤝 Help DigestTelegramBot to become better: Follow the Link. Name and describe the problem you faced, attach the screenshots and/or screen recordings.
💡 Have interesting ideas? Follow the Link. In the Title section, write "New Feature: " and its name. Dindescribe your vision, add links and/or attach references.
Distributed under the MIT License. See LICENSE for more information.
Ivan Ershov - tg: @spiritonchic - i.ershov@innopolis.university
Project Link: https://github.com/mituttta051/Digest-Telegram-Bot
Here are several credits by Team 49.