Sobre o aplicativo
A descrição ainda não está disponível no seu idioma, por isso é exibida em inglês.
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.
- 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.
- 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.
Perguntas frequentes
How do I get a message as JSON with APIDebugBot?▼
Does the bot work in groups?▼
Is it safe to add the bot to a chat?▼
Why can the bot not find an old message?▼
Com base em dados de afiliados