Skip to content

feat(telegram): add user ID mention support via tg://user?id= links#111

Merged
frostming merged 2 commits intobubbuild:mainfrom
dagebot:feat/telegram-mention-by-userid
Mar 13, 2026
Merged

feat(telegram): add user ID mention support via tg://user?id= links#111
frostming merged 2 commits intobubbuild:mainfrom
dagebot:feat/telegram-mention-by-userid

Conversation

@dagebot
Copy link
Contributor

@dagebot dagebot commented Mar 13, 2026

Summary

When users don't have a Telegram username, we can now mention them using tg://user?id=USER_ID links in Markdown format.

Changes

telegram_send.py

  • Added --source-user-id argument for specifying user ID when username is not available
  • Added --source-display-name argument for custom display name in the mention link
  • Mention format: [Display Name](tg://user?id=USER_ID)
  • Fallback priority:
    1. If --source-user-id is provided, use tg://user?id= link mention
    2. If only --source-username is provided, use @username mention
    3. If neither is provided, send without mention prefix

SKILL.md

  • Updated execution policy documentation to mention --source-user-id option
  • Added example command for bot-to-bot communication without username
  • Updated script interface reference with new arguments

Example Usage

# Mention user by ID (no username needed)
uv run ./scripts/telegram_send.py \
  --chat-id -1001234567890 \
  --message "Hello!" \
  --source-is-bot \
  --source-user-id 565293768 \
  --source-display-name "Frost"

Context

This is a common scenario in Telegram where many users don't set a username. Previously, we could only mention users with @username. Now we can mention any user by their numeric ID.

Bub 🤖 added 2 commits March 13, 2026 08:20
When users don't have a username, we can now mention them using
tg://user?id=USER_ID links in Markdown format.

Changes:
- Add --source-user-id and --source-display-name args to telegram_send.py
- Mention format: [Display Name](tg://user?id=USER_ID)
- Falls back to @username if --source-username is provided
- Falls back to @username if neither user ID nor username is provided
- Update SKILL.md with documentation and examples

This enables precise user mentions even for users without Telegram usernames.
Fixes pre-commit end-of-file-fixer check in CI
@frostming frostming merged commit 342b4b3 into bubbuild:main Mar 13, 2026
5 checks 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