mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-25 00:04:30 +00:00
20 lines
435 B
ReStructuredText
20 lines
435 B
ReStructuredText
|
get_history
|
||
|
===========
|
||
|
|
||
|
This example shows how to get the full message history of a chat, starting from the latest message.
|
||
|
|
||
|
.. code-block:: python
|
||
|
|
||
|
from pyrogram import Client
|
||
|
|
||
|
app = Client("my_account")
|
||
|
|
||
|
|
||
|
async def main():
|
||
|
async with app:
|
||
|
# "me" refers to your own chat (Saved Messages)
|
||
|
async for message in app.get_chat_history("me"):
|
||
|
print(message)
|
||
|
|
||
|
|
||
|
app.run(main())
|