Skip to content

Fix send_rich_message_draft business_connection_id TypeError#2

Closed
ranjitsingha wants to merge 1 commit into
coder2020official:botapi101from
ranjitsingha:fix-send-rich-message-draft-business-connection-id
Closed

Fix send_rich_message_draft business_connection_id TypeError#2
ranjitsingha wants to merge 1 commit into
coder2020official:botapi101from
ranjitsingha:fix-send-rich-message-draft-business-connection-id

Conversation

@ranjitsingha

Copy link
Copy Markdown

AsyncTeleBot.send_rich_message_draft (and the sync TeleBot equivalent) forward business_connection_id to the api helpers:

return await asyncio_helper.send_rich_message_draft(
    self.token, chat_id, draft_id, rich_message,
    message_thread_id=message_thread_id, business_connection_id=business_connection_id)

but neither send_rich_message_draft helper (asyncio_helper / apihelper) accepts a business_connection_id parameter, so every call fails with:

TypeError: send_rich_message_draft() got an unexpected keyword argument 'business_connection_id'

Minimal repro (async):

await bot.send_rich_message_draft(chat_id, 1, types.InputRichMessage(html="<tg-thinking>hi</tg-thinking>"))

This adds business_connection_id to both the async and sync helpers and includes it in the payload when set, mirroring how send_rich_message already threads it. Same family as the earlier message_thread_id mismatch.

Targeting botapi101 so it folds into the Bot API 10.1 rich-message work (eternnoir#2602). Verified the draft streams correctly once the helper accepts the kwarg.

AsyncTeleBot/TeleBot.send_rich_message_draft forward business_connection_id
to the api helpers, but neither send_rich_message_draft helper accepts it,
so every call raises TypeError. Add the parameter to both the async and sync
helpers and include it in the payload, mirroring send_rich_message.
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