Ni
APIDebugBot

APIDebugBot: Message JSON in a Second

Mini App • منشئو البوتات

عن التطبيق

الوصف غير متاح بلغتك بعد، لذلك يُعرض باللغة الإنجليزية.

You are building a bot and cannot tell what exactly lands in an update? The docs list the fields, but a live example always teaches faster. APIDebugBot shows how Telegram sees a specific message, formatted as tidy, indented JSON.

It is made for developers and for anyone just getting to know the Bot API. Keep it in a private chat, or add it to the group where you test your own bot.

Two ways to get the JSON

Everything rests on two actions, and neither needs any setup.

  1. Reply with a command. Reply to any message that was not sent by a bot with /debug, and the bot sends that message back as indented JSON.
  2. Forward it. Forward a message straight to the bot in a private chat, and it returns the structure in the same form.

The /help command does not work inside groups, so open the help text in a private chat with the bot. 🙂

What the reply shows

The hierarchy is easy to read: from the message ID and chat data to the sender, the date and the content. If a message has formatting, links or mentions, they sit in a separate entities array with offsets and lengths.

For a newcomer this is a quick way to see how plain text differs from a caption, how a reply to someone else's message looks, and what changes for forwarded posts.

  • Entities. Bold text, links, commands and mentions arrive with exact positions in the string.
  • Media. Photos, documents and stickers are described with their own fields and file identifiers.
  • Forwards. You can see where the message came from and how it was preserved.

Why it helps in a group

The bot also works in groups. A handy setup is a test group with your own bot and APIDebugBot side by side, so real messages sit next to the behavior of your code. Comparing what you expected with what actually arrived gets much easier.

It helps most when your parser crashes on a rare message type and you cannot reproduce it by hand. Just reply to that message with /debug.

Privacy and the cache

To answer replies, the bot caches messages. According to the project description, cached data is available only to people who can reply to that message and therefore already see it. The cache is wiped regularly, at least weekly, and sooner if it grows too large.

Two practical points follow. Do not expect the bot to find an old message a month later. And keep it out of private work chats that contain sensitive data: public or test groups are the better choice.

Who gets the most out of it

  • New bot authors who want to see Bot API objects on live examples.
  • Experienced developers who need to check fields quickly without writing extra debugging code.
  • Writers and teachers who need real message samples for tutorials.

If you need to watch every incoming update of your own bot, you will need logging on your side. APIDebugBot solves a narrower task: showing one message in a readable form.

Debugging habits worth keeping

Save the JSON you get as test data. It makes a good fixture for a unit test of your handler. Strip other people's IDs and names from the saved sample first.

Compare the JSON from the bot with what reaches your code. When the fields differ, the usual cause is a library version, or a library that drops fields it does not know yet.

#Telegram#Mini App#منشئو البوتات

الأسئلة الشائعة

How do I get a message as JSON with APIDebugBot?▼
Reply to the message with /debug and the bot sends it back as indented JSON. The other way is to forward the message to the bot in a private chat, and the answer arrives right away. The command works only for messages not sent by bots.
Does the bot work in groups?▼
Yes, you can add it to a group, including a test one. The /help command does not work in groups, so read the help in a private chat. Avoid using it in groups that hold sensitive data.
Is it safe to add the bot to a chat?▼
The bot caches messages so it can answer replies. According to the project description, only people who can already reply to a message can reach its cached copy. The cache is cleared at least weekly. Still, add the bot only to public or test groups.
Why can the bot not find an old message?▼
The cache is wiped regularly, and sooner when space runs short. Fresh messages work without trouble. For an older sample, forward it to the bot again or save its JSON right away.
3.0

بناءً على بيانات الشراكة

المستخدمونN/A
اللغةEN, RU
موثّقنعم