Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
next_post = cli.iter_messages(
entity,
limit=5,
min_id=your_post_id,
reverse=True
)
I will show the implementation using the example of Pyrogram:
from pyrogram import Client
with Client(session_name="имя .session", api_id="твой api_id", api_hash="api_hash соответственно") as client:
data_channel = client.get_chat("название чата/канала") # получаешь всю информацию о канале с подключенным чатом
chat = data_channel.linked_chat.id # получаешь id чата
for message in client.iter_history(chat, limit=100): # поставь любой лимит
post_id = message['message']
print(post_id) # все данные о сообщении, в том числе его id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question