Skip to content

Instantly share code, notes, and snippets.

View victoriatrinita's full-sized avatar
🏃‍♀️
Progressing

Victoria Trinita victoriatrinita

🏃‍♀️
Progressing
View GitHub Profile
@victoriatrinita
victoriatrinita / telegramRestore.md
Created July 25, 2022 05:58 — forked from avivace/telegramRestore.md
Restore deleted Telegram messages from groups

Restore deleted Telegram messages, medias and files from groups

There's not telegram API method for this, we need to call MTProto methods to retrieve messages from the "Recent Actions" (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion.

from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
from telethon.tl.types import Channel
import time