generated from exteraGramPlugins/pluginBase
Publish plugin / publish (push) Successful in 4s
README now carries the icon, TL;DR, description and features; the technical sections live in docs/. tools/icon_png.py renders images/icon.svg to a square PNG (512x512 by default, --resolution N). plugin.json points at the plugin's own icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
How Unlocked Restrictions works
How copying works
Telegram refuses to forward protected content, and also to re-send its media by file id, so a copy is sent the same way as a message you wrote:
- text keeps its formatting; photos, videos, files, voice messages and GIFs are downloaded (or taken from the local cache) and uploaded again; stickers, locations and contacts are sent directly;
- albums are sent as media groups again (at most 10 items per group);
- bot-only parts are dropped: reply and inline keyboards, games, invoices; content that can't be reproduced (polls, dice, stories, giveaways, paid media) is skipped, and only its text is sent if there is any;
- the selection is sent once every item is ready, so one large download delays the batch;
- items that can't be copied are reported in a bulletin.
Copied videos have no preview thumbnail. The lock covers groups and channels, not private chats where the other person enabled content protection.
Runtime notes
Things the on-device runtime does differently from the SDK docs, all handled in src/:
- Java lists are not iterable from Python; use
hooking.java_list(). param.setResult()in a before-hook does not skip the original method, so the forward hook empties the message list instead.threading.localstate is not shared between a before-hook and its after-hook.- Java
Stringvalues arrive as Pythonstr, otherCharSequences as Java objects. - Fields named like
java.lang.Objectmethods (SendMessageParams.notify) must be set withhook_utils.set_private_field. - Exceptions escaping a Python thread vanish silently, so the copy worker catches everything.
- Shared TL objects (
TLRPC.Chatand friends) are never modified for display purposes.