Aggregate posts from several channels and send it via bot according the rules.
The project uses Poetry for dependency management. Please set up the project following the instructions poetry guide.
To facilitate a smooth development process, it's recommended to have two Telegram accounts. One can be your primary private account and the other a test account. Due to Telegram's strict rules, it's strongly advised to treat the test account as temporary and be prepared for the possibility of it being permanently banned.
Once you have both accounts set up, proceed to create a Telegram bot via BotFather at https://t.me/BotFather. You can connect the bot with you main account.
After setting up the bot, create two new public channels:
- Aggregation channel: This channel should include at least your second account, the bot, and your main account, the bot and the second account should be administrators.
- Test channel (source channel): The bot should not be a member of this channel. This channel will serve to simulate a news channel.
Now for your test account you have to create a new application https://my.telegram.org/apps. Keep in mind that telegram can ban this account for no reason GitHub issue
Create a .env file and fill in all required variables (see .env.example, it contains explanation for every field)
Keep in mind that you can't use the same session in multiple applications simultaneously. So it's recommended to create a session for every application (local setup, container setup, etc.)
make build
make up-all
Note: db should be run in a container
make up-local
alembic revision --autogenerate -m <name>
alembic upgrade heads
You can choose any approach to run unit tests. We provide here two of them.
Approach 1 (terminal): run python -m pytest tests
in your terminal from the source root.
Approach 2 (PyCharm): read here
If you have got Server sent a very new message with ID
when initializing the project, try to refresh your session