Telegram-iOS icon indicating copy to clipboard operation
Telegram-iOS copied to clipboard

Incorrect `ChatAdministratorRights` behavior in Telegram iOS and Telegram for MacOS

Open barsulka opened this issue 1 year ago • 1 comments

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 avatar Dec 18 '24 10:12 barsulka

I have the same issue on Telegram Android v.11.7.0 and Telegram Desktop (Windows) v.5.10.5 when trying to add bot via group members list.

Gooman-rus avatar Jan 25 '25 14:01 Gooman-rus