Wizard Book


Programming Python, Web, Android

Python: Membaca Telegram Message dengan Telethon

Membaca Pesan Telegram dan Pesan Group/Channel Telegram dengan Telethon

from telethon.sync import TelegramClient
import sys

non_bmp_map = dict.fromkeys(range(0x10000, sys.maxunicode + 1), 0xfffd)

with TelegramClient("", "", "") as client:
    for message in client.iter_messages("rikopedia"):
        try:
            print(message.sender_id, ':', message.text.translate(non_bmp_map))
        except:
            print("")

email : contohprogram.com@gmail.com
WA : +6289671400363