If you need to send media files to your telegram channel every 30 minutes from 7 a.m to 1 a.m, this script can do it. It uses 'aiogram' python lib, calculate time and have simple .json file to operate.
- Create a directory/folder 'media' in the same directory/folder where the script is located.
- Create a bot through the Telegram bot 'BotFather' and receive a personal token for your bot. Or, if you already have a bot, get its token.
- Get your personal ID as a nine-digit number. Optional: Get the personal ID of the people you want to connect to the bot (they will only be able to check the number of remaining media)*.
- Get the name of your Telegram channel.
- Input all the info you receive into a .json file.
- Make your bot join your channel.
- Start the script.
- Now you can start sending media to the bot or simply place them in the 'media' directory/folder and the bot will start sending media every 30 minutes.
- Python 3.11 +
- aiogram 3.3.0