feat(telegram): /addcron /removecron /croners group cron-permission commands#1106
Open
mozaa-solana wants to merge 1 commit intonextlevelbuilder:devfrom
Open
feat(telegram): /addcron /removecron /croners group cron-permission commands#1106mozaa-solana wants to merge 1 commit intonextlevelbuilder:devfrom
mozaa-solana wants to merge 1 commit intonextlevelbuilder:devfrom
Conversation
…ommands
Mirror the existing /addwriter /removewriter /writers UX for the cron
permission type so group admins can grant cron-management access without
elevating to full file_writer. Bootstrap policy: first call in a group
is free (no cron managers yet); subsequent calls require an existing
cron manager OR a file_writer.
- new commands_cron_perm.go: handleCronPermCommand (add/remove),
handleListCronPerm; uses store.ConfigTypeCron with scope
"group:<channel>:<chatID>".
- commands.go: route /addcron, /removecron, /croners.
- commands_pairing.go: register the 3 commands in the bot menu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
/addcron,/removecron,/cronersTelegram commands mirroring the existing/addwriter//removewriter//writersUX, but for thecronpermission type so group admins can grant cron-management access without elevating the user to fullfile_writer.Bootstrap policy: first call in a group is free (no cron managers yet); subsequent calls require an existing cron manager or a file_writer.
Changes
internal/channels/telegram/commands_cron_perm.go(new) —handleCronPermCommand(add/remove),handleListCronPerm. Usesstore.ConfigTypeCronwith scopegroup:<channel>:<chatID>.internal/channels/telegram/commands.go— route/addcron,/removecron,/croners.internal/channels/telegram/commands_pairing.go— register the 3 commands inDefaultMenuCommands()so they appear in the Telegram bot menu.Test plan
go build ./...clean/cronerslists empty →/addcron(reply to a member) → bootstrap accepted →/cronerslists the new manager → that user can now use thecrontool while non-managers cannot./removecronrevokes correctly; revoking the last manager re-enables bootstrap.Related
Pairs with #1105 (sender/role propagation through MCP bridge). Without #1105, the cron tool denies even after
/addcronbecause the bridge drops attribution.