Skip to content

feat: extract hashtags from messages and photo captions as bookmark tags - #15

Merged
Madh93 merged 1 commit into
Madh93:mainfrom
sudores:feat/hashtag-tags
Jul 14, 2026
Merged

feat: extract hashtags from messages and photo captions as bookmark tags#15
Madh93 merged 1 commit into
Madh93:mainfrom
sudores:feat/hashtag-tags

Conversation

@sudores

@sudores sudores commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Hashtags written in a Telegram message text or photo caption are now attached to the created Karakeep bookmark as human tags, alongside the existing #telegram tag.

  • TelegramMessage.Hashtags() extracts unique hashtags from both the message text and photo caption using a unicode-aware regex (e.g. #путешествия, #日本語 work), returning names without the leading #.
  • enrichBookmark attaches these hashtags together with the #telegram tag; since enrichment runs for every bookmark type, this covers photo, text, link, and forwarded-channel bookmarks uniformly.
  • Replaced AddTag with AddTags: all tags are sent in a single API call, and the payload is built with json.Marshal instead of string formatting, so tag names with special characters can't break the JSON.

Test plan

  • Added telegram_message_test.go covering hashtags in text, in captions, deduplication, unicode tags, underscores/digits, and bare # edge cases.
  • go build ./..., go vet, and go test ./... all pass.

…rk tags

Hashtags written in a Telegram message or photo caption are now attached
to the created Karakeep bookmark as human tags, alongside the existing
#telegram tag. Tag attachment is batched into a single API call with a
properly JSON-encoded payload.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Madh93
Madh93 merged commit c74e6ef into Madh93:main Jul 14, 2026
1 check passed
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.

2 participants