ductor icon indicating copy to clipboard operation
ductor copied to clipboard

[Feature]: add allowed_group_ids

Open attid opened this issue 9 months ago • 1 comments

Problem or motivation

Add allowed_group_ids anybody can add bot at his group and attack me =\

Proposed solution

add allowed_group_ids with ids groups or * for all

Alternatives considered

No response

Before submitting

  • [x] I have searched existing issues and feature requests for duplicates.

attid avatar Mar 03 '26 12:03 attid

Hey @attid! This is fully shipped in v0.12.0 — and we went a bit further than just the basic allow-list:

What's included:

  • allowed_group_ids in config.json — works exactly like allowed_user_ids. Set it to a list of group chat IDs, or "*" to allow all groups. The bot silently leaves any group not on the list.
  • Hot-reloadable — You can update allowed_group_ids (and allowed_user_ids) in your config file without restarting. Changes take effect within seconds.
  • Group audit — On startup and every 24 hours, the bot checks all active groups against the allow-list and auto-leaves unauthorized ones.
  • /where command — Shows you which chats/groups the bot is currently active in, so you always know where it's running.
  • /leave command — Manually remove the bot from a group.

So if someone adds your bot to their group, it will automatically leave if their group ID isn't in your allowed_group_ids. No more worrying about unauthorized access!

Relevant commits: 7df8b1d, 441bb2d, 0aae360, d667057, 3efd3e5

Closing this — thanks for the suggestion, it was a great security addition!

PleasePrompto avatar Mar 04 '26 08:03 PleasePrompto