Last active
December 16, 2021 12:18
-
-
Save xjxckk/372c3ecd75f52785009ff0e59c8d6b08 to your computer and use it in GitHub Desktop.
Telegram progress updater (Python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telegram | |
from time import sleep | |
bot = telegram.Bot(token='token') | |
msg = bot.send_message(chat_id='Channel ID', text='1/10') | |
# msg = bot.edit_message_text(text='2/10', chat_id='Channel ID', message_id=1) # To edit an old message | |
# print(msg.message_id) | |
for x in range(10): | |
progress = f'{x}/10' | |
print(progress) | |
msg.edit_text(progress) | |
sleep(3) # 3 second timeout needed to avoid Telegram flood control |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment