Telegram Sender logo

Telegram Sender

Community
tao12345666333
telegram-sender

Send and edit Telegram messages, and send photos via Bot API. Use when AnkaLoop needs to send text, reply to a specific message, edit an existing message, send an image, or push proactive notifications (cron results, heartbeat alerts, task status). Requires ANKA_TELEGRAM_BOT_TOKEN env var.

Overview

Publishertao12345666333
Repositoryankaloop
Skill nametelegram-sender
Stars
56
Forks
10
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by tao12345666333 on GitHub. Read the source before you install it.

Installation

Install the Telegram Sender AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/tao12345666333/ankaloop/tree/main/src/ankaloop/builtin_skills/telegram-sender
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tao12345666333/ankaloop.git /tmp/ankaloop
mkdir -p .claude/skills
cp -r /tmp/ankaloop/src/ankaloop/builtin_skills/telegram-sender .claude/skills/telegram-sender
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Telegram Sender in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Telegram Sender on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Telegram Sender is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Telegram Sender

Agent-facing guide for outbound Telegram communication.

Assumption: ANKA_TELEGRAM_BOT_TOKEN is already set in the environment.

Required Inputs

  • chat_id (required) — from inbound message metadata or config
  • message content (required for send/edit)
  • photo source (required for photo): local file path, HTTP(S) image URL, or Telegram file_id
  • photo caption (optional, max 1024 characters after Telegram entity parsing)
  • reply_to_message_id (optional, for threaded reply)
  • message_id (required for edit)

Execution Policy

  1. If handling a Telegram message and message_id is known, prefer reply mode (--reply-to).
  2. If source metadata says sender is a bot (sender_is_bot=true), do not use reply mode; use --source-is-bot --source-username <USERNAME> instead.
  3. For long-running tasks: send an acknowledgment first, then edit it with the final result.
  4. Use photo when the response depends on an image artifact or generated picture.
  5. Prefer local file paths for newly generated images. Use a Telegram file_id only when reusing a previously uploaded file.
  6. Keep content concise and action-oriented.
  7. Use literal newlines in message text and captions.

Active Response Policy

When this skill is in scope, prefer proactive and timely Telegram updates:

  • Send immediate acknowledgment for newly assigned tasks
  • Send progress updates for long-running operations using message edits
  • Send completion notifications when work finishes
  • Send failure notifications immediately with cause, impact, and next action

Recommended pattern:

  1. Send a short acknowledgment reply
  2. Continue processing
  3. Edit the acknowledgment with final result (or send a new update if edit fails)

Command Templates

Paths are relative to this skill directory.

bash
# Send message
python ./scripts/telegram_send.py send \
  --chat-id <CHAT_ID> \
  --message "<TEXT>"

# Reply to a specific message
python ./scripts/telegram_send.py send \
  --chat-id <CHAT_ID> \
  --message "<TEXT>" \
  --reply-to <MESSAGE_ID>

# Bot-source: no direct reply, use @username style
python ./scripts/telegram_send.py send \
  --chat-id <CHAT_ID> \
  --message "<TEXT>" \
  --source-is-bot \
  --source-username <USERNAME>

# Edit existing message
python ./scripts/telegram_send.py edit \
  --chat-id <CHAT_ID> \
  --message-id <MESSAGE_ID> \
  --text "<TEXT>"

# Send photo from local path, URL, or Telegram file_id
python ./scripts/telegram_send.py photo \
  --chat-id <CHAT_ID> \
  --photo "<PATH_OR_URL_OR_FILE_ID>" \
  --caption "<OPTIONAL_CAPTION>"

# Reply with a photo
python ./scripts/telegram_send.py photo \
  --chat-id <CHAT_ID> \
  --photo "<PATH_OR_URL_OR_FILE_ID>" \
  --caption "<OPTIONAL_CAPTION>" \
  --reply-to <MESSAGE_ID>

For actions not covered by this script, use curl to call Telegram Bot API directly: https://api.telegram.org/bot$ANKA_TELEGRAM_BOT_TOKEN/<method>

Script Reference

telegram_send.py send

  • --chat-id, -c: required
  • --message, -m: required
  • --reply-to, -r: optional message ID
  • --token, -t: optional (normally not needed)
  • --source-is-bot: optional flag
  • --source-username: required when --source-is-bot is set

telegram_send.py edit

  • --chat-id, -c: required
  • --message-id, -i: required
  • --text, -x: required
  • --token, -t: optional (normally not needed)

telegram_send.py photo

  • --chat-id, -c: required
  • --photo, -p: required; local file path, HTTP(S) URL, or Telegram file_id
  • --caption, -m: optional caption; Markdown supported and converted to MarkdownV2
  • --reply-to, -r: optional message ID
  • --token, -t: optional (normally not needed)
  • --source-is-bot: optional flag
  • --source-username: required when --source-is-bot is set

Photo behavior:

  • Local paths are uploaded with multipart/form-data.
  • HTTP(S) URLs are downloaded to a temporary file and then uploaded, which avoids CDN content-type issues that can make direct Telegram URL sends fail.
  • Telegram file_id values are sent directly to reuse an existing upload.
  • Captions follow Telegram's sendPhoto limit: 0-1024 characters after entity parsing.

Failure Handling

  • On HTTP errors, inspect API response text and adjust identifiers/permissions.
  • If edit fails (message not editable), fall back to a new send.
  • If reply target is invalid, resend without --reply-to.
  • If photo upload fails, verify the file exists, the URL is publicly fetchable from the current environment, or the file_id belongs to this bot.
  • For task-level failures, notify the user with what failed, what completed, and next steps.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Telegram Sender AI skill do?

Send and edit Telegram messages, and send photos via Bot API. Use when AnkaLoop needs to send text, reply to a specific message, edit an existing message, send an image, or push proactive notifications (cron results, heartbeat alerts, task status). Requires ANKA_TELEGRAM_BOT_TOKEN env var.

Why use Telegram Sender on TypingMind?

Because you install it once and use it with any model. Telegram Sender is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Telegram Sender in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tao12345666333/ankaloop/tree/main/src/ankaloop/builtin_skills/telegram-sender. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Telegram Sender?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Telegram Sender?

As many as you like. As long as a model supports skills, you can use Telegram Sender with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Telegram Sender AI skill free?

Yes. It is published on GitHub by tao12345666333 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇