feat(msg): Add msg sticker add / remove to install sticker sets#30
Merged
Conversation
added 2 commits
June 4, 2026 18:56
`tg msg sticker add <set>` installs a sticker set and `remove` uninstalls it. <set> is a set short name or an https://t.me/addstickers/<name> link. The set is fetched first to validate it and surface its title/count; install reports when Telegram archived the set instead of installing it. Also friendly-map STICKERSET_INVALID (an unknown set short name) to a usage error instead of the raw "rpc error code 400: STICKERSET_INVALID".
Rename the action dispatcher from the noun StickerSet to the verb InstallStickerSet, matching the verb-first action-entry convention and the FaveSticker precedent (a positive verb that covers its inverse via a flag). No behavior change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tg msg sticker add <set>installs a sticker set;tg msg sticker remove <set>uninstalls it.<set>is a set short name or anhttps://t.me/addstickers/<name>link (link forms are stripped to the short name).messages.getStickerSet) to validate it exists and to surface its title/count in the result.addreportsarchived: truewhen Telegram archives the set instead of installing it (e.g. at the installed-set limit).STICKERSET_INVALID(an unknown set short name) to ausageerror (exit 2) instead of the rawrpc error code 400: STICKERSET_INVALID.Test plan
go build ./...,go vet,golangci-lint run,go test ./...addstickers/,t.me/...,https://t.me/..., trailing query), remove pass-through, empty-ref rejection;STICKERSET_INVALIDadded to the usage-family mapping test.removean installed set → gone fromsticker list --installed;add https://t.me/addstickers/<name>→ back in the list (also exercises link parsing). Bogus set name → friendly{"code":"usage","message":"no such sticker set ...","rpc_error":"STICKERSET_INVALID"}(exit 2).add, a sticker from that set sends and lands asmedia.type: sticker.remove, the same self-containedstk_token still sends successfully — install state governs listing, not sendability (the token carries the document ref; Telegram allows sending stickers from sets you're not subscribed to).