Auto-posting from Notion to Telegram: why "the script ran" doesn't mean "the post worked"
In one day I got auto-posting for my personal blog to production status: a card in Notion moves to Scheduled - and about 15 minutes later the post appears on its own in the Telegram channel, with screenshots going to comments.
Important: at the moment of publication there's no "magic" - it's a predictable script (regular Python on a schedule). All decisions about text I make in advance, at the prep stage.
The most unexpected part of this story isn't that "you can build automation in an evening." It's how many little things surface between "the script ran without errors" and "the post actually looks like a post."
Below - 8 pitfalls I stepped on.
1) A "successful publication" can look like a garbage feed
The first run technically succeeded: cover, text, screenshot, two files (CSV with data and MD with a report). Five messages in a row.
Formally - success. In reality - the channel became a dump.
Conclusion: raw data doesn't go into the blog at all. Maximum - screenshots. And file attachments under the post - that's "here's my working folder," not content.
2) Formatting can get lost... silently
Text went out as plain: no highlights, no code. And even worse - Notion managed to turn the file mention repair_schedule.md into a "link to site" schedule.md.
If you don't reread with your eyes, it's easy to leave a live link to nowhere in the post.
What I had to do: separately parse how Notion stores markup/links, and before sending clean out auto-links that appear on their own.
3) There are limits you can't buy
I wanted "image and long text in one message." And hit a hard Telegram limitation:
- caption under a photo - maximum 1024 characters,
- regular message text - up to 4096.
And here's the surprise: Premium doesn't help. This limit is set by the bot interface, and it's the same for everyone.
I tested with probes (1100, 1647, 2048, 2100) - everything bounced with the same: message caption is too long.
Conclusion: you can't simultaneously have all images and long text in one message.
- either images + caption up to 1024,
- or one "header" and full text up to 4096.
For me the workaround through link preview worked: the cover renders on top, and the text stays long.
4) Comments under the post - a separate universe
A comment under a channel post isn't a "comment on the message," but a reply in the linked discussion group to an automatic copy of the post.
To put screenshots there, you need the number of that very copy. The standard way - catch updates from the bot. But that same token is already occupied by another process, and you can't "take away" events from it.
Had to work around it: put a timestamp in the group and look at what messages appeared after it.
And then it turned out the copy doesn't arrive instantly: measurement showed a 4-6 second delay. The script managed to check earlier and only saw my own test messages.
5) Permissions turned out to be more important than code
Even when the search for the right message worked, the bot couldn't "reply to the copy" - Telegram returned message to be replied not found.
The reason wasn't in the code, but in the group settings: in privacy mode a regular participant doesn't see others' messages.
Solution - make the bot an administrator.
6) Raised permissions - changed not one function, but the entire field of vision
And here came a side effect that no one designed.
A few minutes later a comment from the bot appeared under the post - with analysis and questions "is this going to Telegram or the website?". Auto-posting doesn't do that.
Turned out: another process responded, which lives on the same token. After promotion to admin the bot started seeing everything in the group - and someone took my screenshot for an inquiry.
Lesson: raising permissions, you change not one point, but what the entire system working with these keys "sees."
7) "The comment should be from the author, not the bot." And the bot can't do that
There's a requirement: comments should look human - from the author, not the bot.
But in the bot interface you can't choose the sender: the bot always writes from itself.
The only way - send messages as a client on behalf of the account. And there were also small traps there: keys are tied to the application, not to a specific account; plus in discussions by default it's easy to write "on behalf of the channel" rather than from yourself - you have to explicitly switch.
8) A "mine" that didn't explode only because I noticed it in advance
In the content database the same "Telegram" channel value was used for both the personal blog and another channel. The script selected cards by this field.
One status error - and someone else's post could fly to the wrong place.
We split this into two values before a real incident happened.
Numbers (so it's clear this isn't "feelings")
- ~15 minutes - launch period on schedule, without LLM calls at the moment of publication.
- 1024 vs 4096 - caption under photo limit vs message text limit.
- 4-6 seconds - delay of the post copy appearing in the discussion group.
- 1569 characters of text (1647 with heading) - where I hit the caption limit.
- 4 republications until the format became correct.
Final conclusion
Auto-publishing breaks not on "API," but on joints: permissions, default settings, neighboring processes on the same keys, and platform limitations that aren't visible until you hit them head-on.
"The script ran without errors" and "got what I wanted" - different events. The second always needs to be checked with your eyes.