Last active
March 1, 2018 09:41
-
-
Save ashkanRmk/054fd9ae2b2028c4903b7c2a9b61025d to your computer and use it in GitHub Desktop.
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
from telegram import ParseMode | |
from telegram.ext import Updater | |
import time | |
updater = Updater('BOT-TOKEN-ID') | |
chatIds = ["109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", | |
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", | |
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", | |
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", | |
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039"] | |
notSendIds = [] | |
for chat_id in chatIds: | |
try: | |
updater.bot.send_message(chat_id=chat_id, | |
text='*Your Desire Only Text*', | |
parse_mode=ParseMode.MARKDOWN) | |
updater.bot.sendPhoto(chat_id=chat_id, | |
photo='https://telegram.org/img/t_logo.png', | |
caption="Image with Caption!") | |
except: | |
notSendIds.append(chat_id) | |
time.sleep(5) | |
print("\nYour message was not send to these users:\n") | |
for id in notSendIds: | |
print(id) | |
print("\nTotal: " + str(len(notSendIds)) + "/" + str(len(chatIds))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment