Skip to content

feat: telegram allowlist - #135

Closed
krau wants to merge 2 commits into
Crokily:mainfrom
krau:feat/telegram-allowlist
Closed

krau wants to merge 2 commits into
Crokily:mainfrom
krau:feat/telegram-allowlist

Conversation

@krau

@krau krau commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

@Crokily

Crokily commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Thanks @krau for the issue and the PR. The need is real: anyone can find and message a Telegram bot, and a prompt alone is not enough.

#137 solves it with a different approach:

  • One list, wakeFrom, on any channel entry in bot.json (Telegram, Discord, WhatsApp, Slack, …). Only the people and places on it wake the bot. Without the list, nothing changes.
  • Events from people and places not on the list are not dropped: the log keeps who, where and when, but no text and no files. So a wrong ID or a forgotten group can be fixed, and the bot can find your ID from your first DM, while a stranger's text never reaches the model.
  • The check sits in the gateway, where it decides whether to wake the bot. So it covers every update type and every channel, with no settings per platform.
  • No outbound guard. Plainly, because this is the part you may miss: the bot has its token file and a shell, so a guard around send and call would not stop a bot that was tricked. It could call the Bot API with curl, or edit bot.json. The guard would also stop the bot from leaving a group that a stranger added it to. So we keep the protection on the way in: a stranger cannot wake the bot or put text in front of it. If you need hard isolation, run the bot as a separate OS user or on its own machine.
  • From your PR we kept the BotFather /setjoingroups step, the numeric-ID point and your test cases. You are co-author of the commit.

We will close this PR when #137 is merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants