telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.16k stars 5.19k forks source link

KeyboardButtonRequestChat with chat_is_channel == false doesn't add the bot to the chat. #27709

Open Sominemo opened 6 months ago

Sominemo commented 6 months ago

Steps to reproduce

An example of bot markup where it's reproducible:

const _kBotAdminRights = ChatAdministratorRights(
  isAnonymous: true,
  canManageChat: true,
  canDeleteMessages: false,
  canManageVideoChats: false,
  canRestrictMembers: true,
  canPromoteMembers: false,
  canChangeInfo: false,
  canInviteUsers: true,
  canPostMessages: false,
  canManageForum: true,
  canPinMessages: false,
);

sendMessage(
  "Link your chat or channel",
  replyMarkup: ReplyKeyboardMarkup(
    keyboard: [
      [
        // Works
        KeyboardButton(
          text: "📢 Link channel",
          requestChat: KeyboardButtonRequestChat(
            requestId: requestId,
            chatIsChannel: true,
            chatIsCreated: true,
            userAdministratorRights: _kBotAdminRights,
            botAdministratorRights: _kBotAdminRights,
          ),
        ),
      ],
      [
        // Doesn't work
        KeyboardButton(
          text: "👥 Link chat",
          requestChat: KeyboardButtonRequestChat(
            requestId: requestId + 10000,
            chatIsChannel: false,
            chatIsCreated: true,
            userAdministratorRights: _kBotAdminRights,
            botAdministratorRights: _kBotAdminRights,
          ),
        )
      ]
    ],
  ),
);

In TL terms: keyboardButtonRequestPeer with requestPeerTypeChat

Expected behaviour

Telegram Desktop creates a supergroup, adds the bot there and promotes it to admin with requested rights, triggers SharedChat event

Actual behaviour

Telegram Desktop creates a regular group and fails to promote the bot there, the modal window closes. SharedChat event isn't issued to the bot.

The same markup works successfully on Android and iOS apps. Android and iOS clients create supergroups in the given flow.

Operating system

Windows

Version of Telegram Desktop

4.16.2

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

github-actions[bot] commented 2 weeks ago

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

Sominemo commented 2 weeks ago

keep