Skip to content

fix(models): correct BusinessBotRights delete-sent-messages field#286

Open
t1nky wants to merge 1 commit into
go-telegram:mainfrom
t1nky:fix/business-bot-rights-delete-sent-messages
Open

fix(models): correct BusinessBotRights delete-sent-messages field#286
t1nky wants to merge 1 commit into
go-telegram:mainfrom
t1nky:fix/business-bot-rights-delete-sent-messages

Conversation

@t1nky

@t1nky t1nky commented Jun 26, 2026

Copy link
Copy Markdown

BusinessBotRights tags the delete-sent right as can_delete_outgoing_messages, but the Bot API field is can_delete_sent_messages.

This mismatch means the right key is silently dropped on unmarshal (always false) and emitted under the wrong key on marshal.

Ref: https://core.telegram.org/bots/api#businessbotrights

…tRights

Telegram's BusinessBotRights uses `can_delete_sent_messages`, but the
struct only exposed CanDeleteOutgoingMessages tagged
`can_delete_outgoing_messages`, so the right was silently dropped on
unmarshal (always false) and emitted under the wrong key on marshal.

Add CanDeleteSentMessages with the correct tag. The old field is kept as
a deprecated, JSON-ignored alias (`json:"-"`) so existing references keep
compiling; it was always false before, so this changes no behavior.

Ref: https://core.telegram.org/bots/api#businessbotrights
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