Skip to content

feat(message): add sticker source helpers to send stickers#1759

Merged
ernado merged 1 commit into
mainfrom
feat/189-sticker-helpers
Jun 11, 2026
Merged

feat(message): add sticker source helpers to send stickers#1759
ernado merged 1 commit into
mainfrom
feat/189-sticker-helpers

Conversation

@ernado

@ernado ernado commented Jun 11, 2026

Copy link
Copy Markdown
Member

Closes #189.

Adds fluent helpers to telegram/message for picking and sending stickers from the various sticker sources, matching the API sketched in the issue.

API

sender.Self().Sticker(message.FavedStickers()).First(ctx)
sender.Self().Sticker(message.RecentStickers()).ByEmoji(ctx, "😎")
sender.Self().Sticker(message.StickerSetName("AnimatedEmojies")).ByIndex(ctx, 0)

Sources (StickerSource)

Each is backed by the corresponding messages.* RPC:

  • FavedStickers()messages.getFavedStickers
  • RecentStickers() / AttachedRecentStickers()messages.getRecentStickers
  • StickerSet(set) / StickerSetName(shortName)messages.getStickerSet

Selection (*StickerSetBuilder, via Builder.Sticker(source))

  • ByIndex(ctx, i, caption...)
  • ByEmoji(ctx, emoji, caption...) — matches DocumentAttributeSticker.Alt
  • First(ctx, caption...)
  • Stickers(ctx) — exposes the resolved documents

Sending reuses the existing Document(...) media path (a sticker is just an InputMediaDocument); *NotModified/empty results surface clear errors.

Notes

  • ISSUES.md lists message: sticker helpers #189 as already implemented via telegram/query/cached, but that only covers the fetch/cache side — the send-side helpers the issue asked for didn't exist. This fills that gap.

Tests

Offline via tgmock: index/emoji selection, out-of-range, emoji-not-found, set-by-name, and the NotModified error path. Plus a usage example. go test ./telegram/message/ -race and go build ./... pass.

🤖 Generated with Claude Code

Add fluent helpers to pick and send stickers from faved, recent or set
sources via sender.Self().Sticker(source).ByIndex/ByEmoji/First.

Closes #189

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ernado ernado merged commit 2572ecc into main Jun 11, 2026
11 of 12 checks passed
@ernado ernado deleted the feat/189-sticker-helpers branch June 11, 2026 12:58
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.

message: sticker helpers

1 participant