Skip to content

models: add Web App BottomButton type with iconCustomEmojiId support#266

Open
luchojuarez wants to merge 1 commit intogo-telegram:mainfrom
luchojuarez:main
Open

models: add Web App BottomButton type with iconCustomEmojiId support#266
luchojuarez wants to merge 1 commit intogo-telegram:mainfrom
luchojuarez:main

Conversation

@luchojuarez
Copy link
Copy Markdown

Summary

This PR adds support for Telegram Web Apps BottomButton in the models package.

What’s included

  • Added models.BottomButton in models/web_app.go
  • Included all documented fields for the Web Apps object:
    • type
    • iconCustomEmojiId
    • text
    • color
    • textColor
    • isVisible
    • isActive
    • hasShineEffect
    • position
    • isProgressVisible
  • Added models/web_app_test.go with TestBottomButtonJSON to verify JSON unmarshal/marshal behavior and round-trip consistency

Why

Telegram Bot/Web App updates introduced iconCustomEmojiId for BottomButton.
This model makes it easier for users who integrate Mini App payloads in Go to parse and serialize button state with correct field names.

Test plan

  • go test ./models/ -run TestBottomButtonJSON
  • go test ./...

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