ductor
ductor copied to clipboard
[Feature]: add allowed_group_ids
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.
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_idsinconfig.json— works exactly likeallowed_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(andallowed_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.
/wherecommand — Shows you which chats/groups the bot is currently active in, so you always know where it's running./leavecommand — 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!