Last active
April 10, 2018 05:05
-
-
Save RedL0tus/c994a2e2a340251cbed9f9ccc98a6a86 to your computer and use it in GitHub Desktop.
Mark recent dialogs as read in telegram by using telegram-cli and pytg
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
#!/usr/bin/env python3 | |
#-*- encoding: utf-8 -*- | |
# please install pytg and telegram-cli before running this script | |
# pytg: https://github.com/luckydonald/pytg | |
# telegram-cli: https://github.com/vysheng/tg | |
from pytg import Telegram | |
def main(): | |
tg = Telegram( | |
telegram="/path/to/tg-cli/bin/telegram-cli", | |
pubkey_file="/path/to/tg-cli/tg-server.pub") | |
sender = tg.sender | |
count = 0 | |
for i in sender.dialog_list(): | |
count += 1 | |
print(">>> Processing " + i.print_name) | |
sender.mark_read(str(i.print_name)) | |
print(">>> Total " + str(count) + " dialogs processed.") | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment