KitDevguides

KitDev / Guides / PM Permit

PM Permit

Filters who writes to the private chat of your account. If someone you haven't accepted writes to you, the assistant bot replies to them (in inline mode, from your account) with a message of yours and three buttons: Accept, Reject and Block. It is off by default.

It is configured in the assistant: /start → Settings → PM Permit (next to PM Bot).

How it works

  1. Someone writes to you privately and is not accepted: the PM Permit message appears with a warning (1/3).
  2. Each message from them while you don't accept them repeats the notice.
  3. Once the warning limit has been sent (3 by default), the next message replaces the last notice with "You have been blocked" and blocks them on Telegram.
  4. Only the owner can use the buttons; if someone else presses them, they see a notice.
Button What it does
✅ Accept They are accepted: their messages no longer generate notices
❌ Reject The message changes to "rejected" and their messages are silently ignored
🚫 Block Blocks them on Telegram and notes it in the logs group

Settings

  • Enable / Disable
  • Message: your own text, with Telegram formatting. Variables: {mention}, {me}, {warns}, {limit}, {left}. Premium emojis: they are only seen if your account sends the notice (the Delivery option, below). Through inline they come out as a normal emoji.
  • Media: photo, video or GIF that goes with the message.
  • Warnings (➖ / ➕): from 1 to 10.
  • Delivery: how the notice is sent (see "How the notice is sent").
  • Expiry: days an accepted person can go without writing to you before losing the acceptance (see below).
  • Preview: the message with its buttons (in the preview they do nothing).

Commands

Command What it does
.approve / .aprobar Accepts the person
.disapprove / .desaprobar Removes their acceptance and the warnings start over
.approved / .aprobados Lists the accepted people
.alldisapprove / .alldesaprobar Removes the acceptance of everyone (asks for confirmation with buttons; with -y it doesn't ask)

Indicate the person by replying to their message, with their ID or @username from any chat (you don't need to be in their private chat: .aprobar 123456, .desaprobar @username), or by using the command in their private chat. With an ID you don't need to know the person: it is saved anyway. When it finishes, the message says who you accepted or disapproved (name, ID and @username).

List of accepted people

.aprobados shows a table with the name, the ID (in monospace, to copy it) and the @username if they have one. The table is a rich message sent by the assistant. If there are more than 30 people, instead of the table a file aprobados.txt with the list is sent (name | ID | username). Without the assistant, it is shown as a text list.

It is information about your contacts: better use it in your Saved Messages or in a private chat, not in a group.

Removing everyone's acceptance

.alldesaprobar asks first with buttons Yes, remove everyone (green) and Cancel (red). If you confirm, everyone goes back to not accepted, receives the notices again and, even if you write to them, they are not accepted on their own: you have to use .aprobar (same as with .desaprobar). Without the assistant there are no buttons: add -y (.alldesaprobar -y).

If you write first to someone, they are accepted automatically. Bots, saved messages and Telegram's official account are ignored.

How the notice is sent

In Settings → PM Permit → 📤 Delivery you choose between two ways; the button switches between them:

Inline (default) Your account
Who sends it The assistant, "via @bot" Your own account
Accept / Reject / Block buttons Yes No (a userbot can't send buttons)
Premium emojis in the text No: they come out as the normal emoji Yes, if your account has Telegram Premium
Photo, video or GIF of the notice Yes Yes

Why: according to Telegram's documentation, premium emojis are not supported in inline messages, and only the assistant can send buttons. With Your account, people are accepted or rejected with the .aprobar and .desaprobar commands (the notice, the notices counter and the block when the limit is reached work the same). The assistant's preview is shown just as the person will see it: with buttons in inline and without them in Your account.

If your account doesn't have Premium, the Your account mode also sends normal emojis (the menu warns you). The notices KitDev sends on its own don't count as something you wrote: they don't accept the person automatically and don't take you out of AFK mode.

Acceptance expiry

An accepted person loses the acceptance if 7 days pass without writing to you (default). Each message they send you privately counts; you writing to them doesn't restart the time. After the deadline, the next time they write they receive the PM Permit notices again, and they disappear from the .aprobados list. If you later write to them first, they are accepted again on their own.

It is configured in the assistant: /start → Settings → PM Permit → ⏳ Expiry. You send the days as a whole number: 0 turns it off (acceptances don't expire) and there is no maximum. Reset goes back to 7 days. The time is measured even if PM Permit is off. People who were already accepted when updating start with the full period from that moment.

Forwarding your private chats

In the same menu (/start → Settings → PM Permit) there are two more buttons:

  • Forward private chats: on/off: every message written to you privately is forwarded to a group. Your account does it, so photos, videos and the sender's name are kept. If a message can't be forwarded (for example, protected content), the assistant sends a summary with the text.
  • Destination: the default is the logs group. With this button you send the ID of another group (for example -1001234567890) or its @username, and KitDev checks that it works before saving it. With Use the logs group you go back to the default group.

When choosing a group, KitDev checks that your account is inside, that the assistant is added as administrator and that it can write (it sends a test message). If something is missing, it tells you what: "add the bot to the group", "make it an administrator", etc. If a forward fails later (for example, the bot was removed), the assistant warns you in your chat with it, at most once an hour.

Forwarding works even if PM Permit is off.

Notes

  • Several messages in a row (for example an album) count as a single notice.
  • It needs the assistant bot's inline mode (enabled by itself). If it fails, the same text is sent without buttons.
  • The notices and the accepted people are stored in data/kitdev.sqlite3.