Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect ChatAdministratorRights behavior in Telegram iOS and Telegram for MacOS #1647

Open
barsulka opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@barsulka
Copy link

Checklist

  • [ x ] I am reporting an issue in existing functionality that does not work as intended
  • [ x ] I've searched for existing GitHub issues

Prerequisites

  1. You need to have four different Telegram clients:

    • Telegram Desktop 5.9
    • Telegram for MacOS 11.5.269855 Stable
    • Telegram for Android 11.5.4 (5528)
    • Telegram iOS 11.5.1
  2. You need a Telegram bot (either use an existing one or create a new one via BotFather).

  3. You need a non-private group to which the Telegram bot has not been added yet.

Steps to Reproduce

  1. Obtain the bot token {botId:botToken} from BotFather and the link https://t.me/{SomeBot}.

  2. Call the setMyDefaultAdministratorRights method via the Bot API, setting all 15 rights to false:

    curl -X POST 'https://api.telegram.org/bot{botId:botToken}/setMyDefaultAdministratorRights' \
      -H 'Content-Type: application/json' \
      -d '{"rights":{"can_change_info":false,"can_delete_messages":false,"can_delete_stories":false,"can_edit_messages":false,"can_edit_stories":false,"can_invite_users":false,"can_manage_chat":false,"can_manage_topics":false,"can_manage_video_chats":false,"can_pin_messages":false,"can_post_messages":false,"can_post_stories":false,"can_promote_members":false,"can_restrict_members":false,"is_anonymous":false}}'

Expected response: {"ok":true,"result":true}

  1. Verify the rights by calling getMyDefaultAdministratorRights:

    curl -X GET 'https://api.telegram.org/bot{botId:botToken}/getMyDefaultAdministratorRights'

    Expected response:

    {
      "ok": true,
      "result": {
        "can_manage_chat": false,
        "can_change_info": false,
        "can_delete_messages": false,
        "can_invite_users": false,
        "can_restrict_members": false,
        "can_pin_messages": false,
        "can_manage_topics": false,
        "can_promote_members": false,
        "can_manage_video_chats": false,
        "can_post_stories": false,
        "can_edit_stories": false,
        "can_delete_stories": false,
        "is_anonymous": false
      }
    }

    Note: You see 13 rights set to false. The can_post_messages and can_edit_messages rights apply only to channels, so their absence here is expected.

  2. Open the link to add the bot to the group (as indicated in the official documentation): https://t.me/{SomeBot}?startgroup=1

  3. In the window that appears, select the group to which the bot has not been added before.

Expected Behavior

One of two outcomes is expected:

  • A confirmation prompt with "ok/cancel" appears before adding the bot, or
  • A bot addition settings window opens where all admin rights toggles are off (especially the "Manage Group"
    toggle).

Actual Behavior

Client Behavior Screenshot
✅ Telegram for Android 11.5.4 An "Add Bot" window appears with toggles, where the "Manage Group" toggle is off, and at the bottom the button reads "Add bot as Member" android
✅ Telegram Desktop 5.9 A confirmation dialog appears: "Add the bot to {groupname}?" with "cancel" and "ok" buttons desktop
❌ Telegram for MacOS 11.5.269855 An "Add Bot" window opens where all rights are turned on, including "Admin Rights", and at the bottom the button reads "Add Bot as Admin" macos
❌ Telegram iOS 11.5.1 An "Add Bot" window opens where all rights are turned on, including "Admin Rights", and at the bottom the button reads "Add Bot as Admin" ios

Environment

Device: any

iOS version: any

App version: 11.5.1

@barsulka barsulka added the bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant