Skip to main content

MPChat Bot & MiniApp FAQ (chat_id, 409, file_id, 429, initData, and more)

Quick answers to common MPChat bot and MiniApp questions: getting a chat_id, fixing 409, file_id reuse, 429 handling, and which methods are unsafe to test.

Quick answers to the questions developers hit first. For parameter-level details, see core.mp.net/bots.


Overview

Common questions grouped by topic. If your issue is not here, check the relevant guide in this collection.

Getting started

  • Where do I start? Non-developers: try a bot in 10 minutes (Windows / iOS). Developers: the curl + Node.js quickstart.

  • What is an mpbot? A test/dev bot with its own token and API permissions, kept isolated from production.

  • Where do I store the token? Environment variables or secret management. Never in git, logs, or the frontend.

Messaging

  • Why can't the bot DM first? A user must establish context; sendMessage needs a valid chat_id.

  • How do I get a chat_id? User sends a message → getUpdates → read message.chat.id. In private chats it usually equals the user id.

  • getUpdates returns []? No message yet, or the batch was consumed. Check offset and webhook state.

  • getUpdates returns 409? A webhook is enabled (mutually exclusive). Confirm with getWebhookInfo; do not run deleteWebhook yourself.

Media and limits

  • Can I reuse a file_id? No. Use a public URL or multipart.

  • Does banChatMember kick? No — it mutes (restricted). Lift with unbanChatMember. L3 DocOnly.

  • Why are sendPoll / sendLocation unavailable? They currently return 501.

  • Got a 429? Stay at or below 30 req/s and add exponential backoff.

MiniApp

  • Can frontend data log a user in directly? No. The backend must verify the initData signature; initDataUnsafe is UI only.

Safety

  • Which methods are unsafe to test? DocOnly: logOut, leaveChat, deleteMessage(s), banChatMember, setWebhook, deleteWebhook.

  • Where is the official reference? core.mp.net/bots — parameter-level source of truth.

Related

This FAQ summarizes behavior that may change. Always confirm current status on the official methods page.

Did this answer your question?