agentsclimarketplace

Telegram send

Skill aAAaqwq/AGI-Super-Team/skills/telegram-send

Telegram DM sending from CSV, rate limiting, idempotencyFrom its SKILL.md

Install
npx -y skills add aAAaqwq/AGI-Super-Team --skill telegram-send

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

4.5 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Telegram Send

Sending messages via Telegram (Telethon) with CSV input

When to use

  • "send via telegram"
  • "message everyone through telegram"
  • "telegram campaign"
  • When preferred_channel = Telegram in data

Dependencies

  • Python 3, Telethon, python-dotenv
  • Active Telegram session

Paths

WhatPath
Tool$TG_TOOLS_PATH/tools/tg_send.py
Shared lib$TG_TOOLS_PATH/tg_utils/
Telegram Session$SALES_PATH/telegram/sessions/telegram_session.session
ENV$SALES_PATH/.env
Send Log$TG_TOOLS_PATH/data/send_log.json

How to run

Step 1: Prepare CSV

Claude prepares CSV with recipients. Minimum columns:

key,name,phone,username,message
p-001,Alice,+380XXXXXXXXX,,Hello Alice! Message text.
p-002,Ruslan,,,Nizami_ua,Hello Ruslan!

Or without the message column -- then use the --message template.

Step 2: Dry-run (verification)

python3 $TG_TOOLS_PATH/tools/tg_send.py \
    --input contacts.csv --dry-run

Or with a template:

python3 $TG_TOOLS_PATH/tools/tg_send.py \
    --input contacts.csv --message "Hello, {name}! Text." --dry-run

Step 3: Send

python3 $TG_TOOLS_PATH/tools/tg_send.py \
    --input contacts.csv --send

# Or test on the first contact:
python3 $TG_TOOLS_PATH/tools/tg_send.py \
    --input contacts.csv --send --test 1

Parameters

ParameterDescriptionDefault
--input FILECSV file (or - for stdin)required
--message TMPLMessage template with {name}-
--message-file FILETemplate from file-
--dry-runPreview onlytrue (default)
--sendActual sendingfalse
--test NSend only to first N-
--max NMax number of messages-
--coldLimits for cold outreach (5/day, batch pauses)false
--delay MIN MAXOverride delay (sec)20 60
--statusShow send log-
--reset-logReset log-
--reset-cooldownReset flood cooldown-
--key-col NAMEColumn for idempotencykey
--name-col NAMEColumn for namename
--phone-col NAMEColumn for phonephone
--user-col NAMEColumn for usernameusername
--msg-col NAMEColumn for messagemessage

Architecture

Claude (LLM) is responsible for: selecting recipients, composing text, generating CSV, interpreting results, updating CRM.

tg-send is responsible for: Telegram session, phone normalization, message delivery, rate limiting, idempotency, flood handling.

Shared library (tg_utils/)

ModulePurpose
auth.pyConnecting to Telegram, loading credentials
phone.pyPhone normalization (UA/PL/IE/US)
rate_limit.pyDelays, batch pauses, flood cooldown
send_log.pySend log (idempotency)
contacts.pyEntity resolution (username/phone), ImportContactsRequest
output.pyJSON-line output for composition

Rate Limiting

ModeDelayLimit/dayBatch pause
Warm (default)20-60s35-
Cold (--cold)30-60s530min every 3

Output

Stdout: JSON lines (for pipe/composition):

{"event":"send","status":"ok","key":"p-001","target":"@user","name":"Alice","ts":"..."}
{"event":"summary","sent":5,"failed":1,"skipped":2,"ts":"..."}

Stderr: human-readable progress.

Limitations

  • Not all phone numbers are registered on Telegram
  • Privacy settings can block (UserPrivacyRestrictedError)
  • FloodWaitError = 24h cooldown, PeerFloodError = 48h cooldown
  • Temporary contacts are automatically removed after sending

Troubleshooting

ProblemSolution
FloodWaitErrorAutomatic 24h cooldown. --reset-cooldown to reset
PeerFloodError48h cooldown. Wait or --reset-cooldown
SessionExpiredtelegram-session
UserPrivacyRestrictedErrorPerson has blocked DMs
"Not authorized"Need QR login via tg-auth

Related skills

  • telegram-check -- checking replies
  • telegram-session -- if session is broken
  • email-send-direct -- single email
  • email-send-bulk -- mass email sending
  • whatsapp-send -- alternative channel

Related tools

All Telegram tools: $TG_TOOLS_PATH/tools/

  • tg-auth -- session, QR login
  • tg-contacts -- export/import contacts, lookup
  • tg-groups -- groups, posting, members
  • tg-scrape -- channel search, scraping

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.