Skip to content

feat: Implement Telegram Group Management prisms - #924

Open
sureshchouksey8 wants to merge 3 commits into
Spectral-Finance:mainfrom
sureshchouksey8:feature/telegram-group-mgmt-65-new
Open

feat: Implement Telegram Group Management prisms#924
sureshchouksey8 wants to merge 3 commits into
Spectral-Finance:mainfrom
sureshchouksey8:feature/telegram-group-mgmt-65-new

Conversation

@sureshchouksey8

@sureshchouksey8 sureshchouksey8 commented Jul 11, 2026

Copy link
Copy Markdown

Refs #65.

This PR provides a focused Telegram group-management foundation: permissions-aware promotions, moderation actions, invite links, and join-request approval or decline, with request-option handling separated from Bot API JSON payloads.

It does not claim the complete #65 delivery. Broader spam protection, admin action logging, performance validation, and full coverage evidence remain follow-up work unless maintainers explicitly accept this partial slice.

@MyTH-zyxeon

Copy link
Copy Markdown

Review assist for #65 at current head ab27b2f1ed60385050d2dcfa1963a3a05077c943 (OPEN / MERGEABLE / REVIEW_REQUIRED; no prior comments, reviews, or visible checks):

  1. The new handlers put :plug inside request_body (for example Map.take(params, [:chat_id, :user_id, :until_date, :plug])) and then call Client.request/3 with only %{json: request_body}. The tests pass a tuple such as {Req.Test, __MODULE__} as params.plug, so Req/Jason is asked to JSON-encode that test tuple instead of receiving it as the top-level client option. This makes the claimed tests non-runnable and also leaks a test-only field into Telegram payloads. Please remove :plug from JSON bodies and, if per-test injection is needed, pass it as request_opts[:plug] (the existing UnitAPICase Telegram client config may already be sufficient).

  2. PromoteChatMember exposes only is_anonymous and can_manage_chat; it cannot express the core admin permissions needed for Telegram Group Management ($1,800) #65 (delete messages, restrict members, invite users, pin messages, manage topics/video chats, etc.). The generic validate_param/2 also accepts maps for scalar IDs, so direct handler calls can send invalid user_id values despite the declared schema.

  3. This 20-file slice implements ten CRUD-style Bot API calls, but Telegram Group Management ($1,800) #65 still requires content moderation, spam protection, admin action logging, documentation/examples, >90% coverage evidence, performance validation, and a clear member-add path (invite link or join-request approval, since bots cannot directly add arbitrary members). Please either narrow the PR body to a partial group-management slice or add the missing acceptance surfaces and focused validation proof.

Run-Id: run-20260712T020631Z-misa3-revenue-cycle-lux924-review
Trace-Id: 96e48c8f-2cc8-40e3-a069-e8dd46209d8f
Requester: service automation ID million-dollar-revenue-cycle
Implementer: MISA 3 bot ID 1516725819517567077

@sureshchouksey8
sureshchouksey8 force-pushed the feature/telegram-group-mgmt-65-new branch from 612333a to 4539ede Compare July 12, 2026 15:35
@sureshchouksey8
sureshchouksey8 force-pushed the feature/telegram-group-mgmt-65-new branch from 4539ede to a26a02e Compare July 12, 2026 15:35
@sureshchouksey8

Copy link
Copy Markdown
Author

I've applied the requested fixes:

  • Removed :plug from the JSON body in tests/handlers across all Group Management prisms, passing it only in request_opts.
  • Updated PromoteChatMember to expose core admin permissions (can_delete_messages, can_restrict_members, can_invite_users, can_pin_messages, can_manage_topics, can_manage_video_chats, etc.) and ensured validate_param strictly checks types (removed map type matching for scalar IDs).
  • Added missing acceptance surfaces for content moderation (DeleteMessage), member-add path / invite link (CreateChatInviteLink), and join-request approvals (ApproveChatJoinRequest, DeclineChatJoinRequest).

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