Skip to content

feat(telegram): /addcron /removecron /croners group cron-permission commands#1106

Open
mozaa-solana wants to merge 1 commit intonextlevelbuilder:devfrom
mozaa-solana:feat/telegram-cron-perm-cmds
Open

feat(telegram): /addcron /removecron /croners group cron-permission commands#1106
mozaa-solana wants to merge 1 commit intonextlevelbuilder:devfrom
mozaa-solana:feat/telegram-cron-perm-cmds

Conversation

@mozaa-solana
Copy link
Copy Markdown

Summary

Adds /addcron, /removecron, /croners Telegram commands mirroring the existing /addwriter / /removewriter / /writers UX, but for the cron permission type so group admins can grant cron-management access without elevating the user 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.

Changes

  • internal/channels/telegram/commands_cron_perm.go (new) — handleCronPermCommand (add/remove), handleListCronPerm. Uses store.ConfigTypeCron with scope group:<channel>:<chatID>.
  • internal/channels/telegram/commands.go — route /addcron, /removecron, /croners.
  • internal/channels/telegram/commands_pairing.go — register the 3 commands in DefaultMenuCommands() so they appear in the Telegram bot menu.

Test plan

  • go build ./... clean
  • Manual test: in a group, /croners lists empty → /addcron (reply to a member) → bootstrap accepted → /croners lists the new manager → that user can now use the cron tool while non-managers cannot.
  • /removecron revokes 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 /addcron because the bridge drops attribution.

…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.
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.

1 participant