Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13981

Telegram get chat messages /posts - python Telethon

$
0
0

I am using Telethon and Python 3.6xx

Been able to retreive message from groups, no problem but when it comes to channels I am stuck.

dialogs = client(get_dialogs)for chat in dialogs.chats:   getmessage = client.get_messages(chat.id, limit=400)   for message in getmessage:        print(message.message)

I've searched the telethon documentation but most answers were in response to the old get_message_history.

When I'm trying with the following chat.id = 1097988869 (news.bitcoin.com) I'm getting an error below (for groups the chat.id works fine):

PeerIdInvalidError: An invalid Peer was used. Make sure to pass the right peer type


Viewing all articles
Browse latest Browse all 13981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>