Created
May 7, 2017 15:02
-
-
Save Kylmakalle/1132315523fee96c386b3330cdcdde13 to your computer and use it in GitHub Desktop.
Script that checks bot possibility to delete messages
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 requests | |
tokens = { | |
'123454321:abcdefghABCDEFGHIoqwe-123ejksdaaasd', | |
'987654321:xyzzyxABCabcTELEBOTadasd12389012nss', | |
'123456789:AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLL', | |
} | |
for token in tokens: | |
r = requests.get('https://api.telegram.org/bot{}/getMe'.format(token)) | |
a = requests.get('https://api.telegram.org/bot{}/deletemessage?chat_id=-12345&message_id=123'.format(token)) | |
if 'method not found' in a.text: | |
print(r.text.split('"username":')[1][:-2], "Can't delete") | |
else: | |
print(r.text.split('"username":')[1][:-2], 'Can delete') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment