Skip to content

fix: use correct options for chat permissions - #952

Open
KnightNiwrem wants to merge 1 commit into
v2from
fix/all-chat-permissions
Open

KnightNiwrem wants to merge 1 commit into
v2from
fix/all-chat-permissions

Conversation

@KnightNiwrem

Copy link
Copy Markdown
Member

Note

This PR was primarily written by GPT-5.6 Sol xhigh in ChatGPT Work.

Summary

Replace the administrator-right fields currently exported as ALL_CHAT_PERMISSIONS with the actual fields from ChatPermissions.

This also:

  • includes the current can_react_to_messages and can_edit_tag permissions
  • uses satisfies ChatPermissions to reject unrelated fields
  • corrects the documentation link to the Bot API's ChatPermissions section

Why

ALL_CHAT_PERMISSIONS is intended for calls such as restrictChatMember to lift all restrictions from a user. The v2 constant currently contains ChatAdministratorRights fields instead, so it does not grant the send permissions described by its documentation.

This was fixed on main in #874. This PR applies the same correction to v2 while matching the current set of chat permissions.

Verification

  • deno fmt --check src/convenience/constants.ts
  • deno lint src/convenience/constants.ts
  • deno check --no-config src/convenience/constants.ts
  • verified that the constant contains exactly the 16 current chat-permission fields and that every value is true

@KnightNiwrem
KnightNiwrem marked this pull request as ready for review August 15, 2026 18:05
@KnorpelSenf KnorpelSenf added the v2 related to grammY 2.0 label Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 related to grammY 2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants