KitDevguides

KitDev / Guides / PM Bot

PM Bot

With PM Bot, anyone can write to your assistant bot and you receive their message on Telegram, without giving them your personal account. It is off by default.

It is configured in the assistant: /start → Settings → PM Bot.

How it works

  1. Someone opens your bot and presses Start. They receive your welcome message.
  2. Everything they write (text, photos, audio...) reaches you forwarded. It replies to them with a confirmation notice.
  3. To answer them, reply to the forwarded message. Your reply is delivered to that person and the bot tells you ✅ Entregado.
  4. Replying /ban to a forwarded message blocks that person, and /unban unblocks them. You can also use /unban ID.

Someone who is blocked gets no reply. The texts the person sees come out in the language you have chosen in the assistant.

PM Bot settings

Button What it does
Enable / Disable Turns PM Bot on or off. When off, the bot tells whoever writes that it doesn't receive messages
Receive in Where messages reach you: the bot's chat or the logs group
Welcome message The text seen by whoever starts the bot
Welcome media A photo, video or GIF that goes with the welcome
Start buttons Link buttons below the welcome (see below)
Format Normal or rich text, compact cells, inline or rich buttons and premium emoji in the welcome (see below)
Texts The three notices received by whoever writes (see below)
Antispam Blocks alphabets (see below)
Preview Sends you the welcome as the other person will see it

Variables of the welcome and the notices:

Variable Replaced by
{me} Your name
{mention} A mention of whoever writes

To go back to the default text use ↩ Reset.

Start buttons

With Start buttons you choose the link buttons that appear below the welcome message when someone starts the assistant. If none is set, nothing appears: just the welcome.

  • ➕ Add buttons: you send one button per line in the format Text | link. You can send several in the same message.
  • The link can be https://…, t.me/…, tg://… or @user. The text supports up to 40 characters.
  • To give a button a color, add verde (green), rojo (red) or azul (blue) at the end of the line: My channel | https://t.me/mychannel | verde.
  • To put a premium emoji before the text, in two ways:
  • Paste the premium emoji at the start of the line: 🔥 My channel | https://t.me/mychannel. KitDev takes its ID by itself.
  • Or add its numeric ID at the end, as is: Shop | https://t.me/myshop | 5368324170671202286. If there is a color, both go in any order: Shop | @user | verde | 5368324170671202286.
  • If you paste the emoji and also type an ID, the pasted emoji wins.
  • At most 10 buttons, one per row. Lines that aren't understood are skipped and shown to you.
  • Tap a button in the list to remove it, or use 🧹 Remove all. 👁 Preview sends you the welcome as the other person will see it.
  • If Telegram rejects a link when sending, the welcome goes out without buttons so nobody is left without it.

Example:

Mi canal | https://t.me/micanal
Soporte | @usuario

Welcome format

With ✨ Format you decide how the welcome looks. Everything is optional and changes with a tap:

Option What it does
Text: Normal / Rich Normal is the usual message. Rich sends it as a rich message: the media goes inside and the Label ~ value lines are shown as a table
Compact cells Makes the tables of the rich text narrower
Buttons: Inline / Rich Inline are the usual buttons, below the message. Rich ones go inside the message and with color; they require the rich format, so turning them on sends the welcome as a rich message
Premium emoji in text Keeps the premium emojis you put in the text. Telegram only shows them in bot messages if the bot's owner has Premium (Bot API 9.4); otherwise they come out as normal emojis
Premium emoji in buttons Shows before each button's text the premium emoji you gave it (icon_custom_emoji_id of the Bot API). Same condition: the owner with Premium. Without this, buttons come out without an emoji and nothing is deleted
  • If Telegram rejects a format, the welcome is sent with a simpler one: first the buttons without their premium emoji (they are still there), then the text without premium emojis, and if not, as a normal message with inline buttons. Nobody is left without a welcome.
  • The Preview shows how the other person will see it. The media is still changed in Welcome media.
  • This only changes the welcome. The PM Bot notices and the rest of the assistant's messages don't change.

Texts

In Texts you can change the three notices received by whoever writes to the bot:

Notice When it is sent
Notice with PM disabled PM Bot is off (at most once per minute per person)
Message limit notice They write more than 5 messages in a minute
Delivery confirmation Their message reached you

Message limit

Each person can send up to 5 messages per minute. When they go over, they receive the limit notice only once, you get an alert with their name and ID, and their messages are ignored until the minute passes. To block them, reply /ban to one of their messages.

Alphabet antispam

In Antispam you choose which alphabets to block: Chinese, Arabic and Russian. If someone writes 3 or more characters of a blocked alphabet:

  1. They are blocked instantly.
  2. They receive a message with the reason. You can change it with Block message. It supports {motivo} (the detected alphabet, for example Russian), {mention} and {me}. In English, {reason} is the same as {motivo}.
  3. A notice reaches the logs group with their name, ID, the alphabet and the message, and how to unblock them: /unban ID to the bot.

The antispam only looks at the messages of whoever writes to the bot, not groups. You can turn it on and off without losing the list of alphabets.

Where the data is stored

The people who have written to the bot (for the broadcast and the blocks) are stored in data/kitdev.sqlite3. Whoever starts the bot is also saved in the saved contacts, with their profile data. The settings, in data/state.json. Neither is uploaded to Git.

In the logs group, /ban and /unban are those of this PM Bot. That's why the administrator mode doesn't work in that group.

If something doesn't work, see Troubleshooting.