Skip to content

fix: decode draft_id sent as a string in stopped_message_generation - #58

Open
darxnet wants to merge 1 commit into
mainfrom
fix/draft-id-string
Open

darxnet wants to merge 1 commit into
mainfrom
fix/draft-id-string

Conversation

@darxnet

@darxnet darxnet commented Nov 16, 2026

Copy link
Copy Markdown
Owner

The Bot API server serializes MessageGenerationStopped.draft_id as a JSON
string although it is documented as an Integer (tdlib/telegram-bot-api#945,
Client.cpp uses td::to_string). The update failed to decode, was skipped
as UndecodableUpdateError and HandleOnStoppedMessageGeneration never ran,
so a bot kept generating after the user pressed Stop. draft_id now accepts
both a number and a numeric string; DraftID stays int64.

The Bot API server serializes MessageGenerationStopped.draft_id as a JSON
string although it is documented as an Integer (tdlib/telegram-bot-api#945,
Client.cpp uses td::to_string). The update failed to decode, was skipped
as UndecodableUpdateError and HandleOnStoppedMessageGeneration never ran,
so a bot kept generating after the user pressed Stop. draft_id now accepts
both a number and a numeric string; DraftID stays int64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant