telegram
Integracao completa com Telegram Bot API. Setup com BotFather, mensagens, webhooks, inline keyboards, grupos, canais. Boilerplates Node.js e Python.
What this skill does
# Telegram Bot API - Integracao Profissional
## Overview
Integracao completa com Telegram Bot API. Setup com BotFather, mensagens, webhooks, inline keyboards, grupos, canais. Boilerplates Node.js e Python.
## When to Use This Skill
- When the user mentions "telegram" or related topics
- When the user mentions "bot telegram" or related topics
- When the user mentions "telegram bot" or related topics
- When the user mentions "api telegram" or related topics
- When the user mentions "chatbot telegram" or related topics
- When the user mentions "mensagem telegram" or related topics
## Do Not Use This Skill When
- The task is unrelated to telegram
- A simpler, more specific tool can handle the request
- The user needs general-purpose assistance without domain expertise
## How It Works
Skill para implementar bots profissionais no Telegram usando a Bot API oficial. Suporta Node.js/TypeScript e Python.
### Overview
A Telegram Bot API permite criar bots que interagem com usuarios via mensagens, comandos, inline keyboards, pagamentos e muito mais. Bots sao criados pelo @BotFather e autenticados via token unico.
**Base URL:** `https://api.telegram.org/bot<TOKEN>/METHOD_NAME`
**Metodos HTTP:** GET e POST
**Formatos de parametros:** query string, application/x-www-form-urlencoded, application/json, multipart/form-data (uploads)
**Limite de arquivos:** 50MB download, 20MB upload (via multipart), 50MB via URL
**Portas suportadas para webhooks:** 443, 80, 88, 8443
**Pre-requisitos:**
- Conta no Telegram
- Bot criado via @BotFather (fornece o token)
- Token no formato: `123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11`
Se o usuario nao tem um bot criado, oriente a conversar com @BotFather no Telegram e enviar `/newbot`.
---
## Decision Tree
```
O usuario precisa criar um bot?
├── SIM → Secao "Setup com BotFather" abaixo
└── NAO → Qual linguagem?
├── Node.js/TypeScript
└── Python
→ O que quer fazer?
├── Enviar mensagens → Secao "Tipos de Mensagem"
├── Receber mensagens → Secao "Receber Updates"
├── Teclados interativos → Secao "Keyboards"
├── Gerenciar grupos/canais → references/chat-management.md
├── Webhook setup → references/webhook-setup.md
├── Inline mode → references/advanced-features.md
├── Pagamentos → references/advanced-features.md
├── Bot de atendimento com IA → Secao "Automacao com IA"
└── Referencia completa da API → references/api-reference.md
```
Para iniciar um projeto do zero com boilerplate pronto:
```bash
python scripts/setup_project.py --language nodejs --path ./meu-bot-telegram
## Ou
python scripts/setup_project.py --language python --path ./meu-bot-telegram
```
Para testar se o token do bot funciona:
```bash
python scripts/test_bot.py --token "SEU_TOKEN"
```
Para enviar uma mensagem de teste:
```bash
python scripts/send_message.py --token "SEU_TOKEN" --chat-id "CHAT_ID" --text "Hello!"
```
---
## Setup Com Botfather
1. Abra o Telegram e busque @BotFather
2. Envie `/newbot`
3. Escolha nome de exibicao (ex: "Meu Bot Incrivel")
4. Escolha username (deve terminar com "bot", ex: `meu_incrivel_bot`)
5. BotFather retorna o token - guarde com seguranca
6. Comandos uteis do BotFather:
- `/setdescription` - descricao do bot
- `/setabouttext` - texto "sobre" do bot
- `/setuserpic` - foto de perfil
- `/setcommands` - lista de comandos
- `/mybots` - gerenciar bots existentes
- `/setinline` - habilitar inline mode
- `/setprivacy` - modo privacidade em grupos
---
## Variaveis De Ambiente
```env
TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
```
## Node.Js/Typescript
```typescript
// Instalar: npm install telegraf dotenv
// Para TypeScript: npm install -D typescript
import { Telegraf } from 'telegraf';
import dotenv from 'dotenv';
dotenv.config();
const bot = new Telegraf(process.env.TELEGRAM_BOT_TOKEN!);
bot.start((ctx) => {
ctx.reply('Ola! Eu sou seu bot. Como posso ajudar?');
});
bot.on('text', (ctx) => {
if (!ctx.message.text.startsWith('/')) {
ctx.reply(`Voce disse: ${ctx.message.text}`);
}
});
bot.launch();
```
## Python
```python
## Instalar: Pip Install Python-Telegram-Bot Python-Dotenv
import os
from dotenv import load_dotenv
from telegram import Update
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
load_dotenv()
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text('Ola! Eu sou seu bot. Como posso ajudar?')
async def echo(update: Update, context: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text(f'Voce disse: {update.message.text}')
app = Application.builder().token(os.getenv('TELEGRAM_BOT_TOKEN')).build()
app.add_handler(CommandHandler('start', start))
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, echo))
app.run_polling()
```
## Sem Biblioteca (Http Puro)
```python
import requests
TOKEN = "SEU_TOKEN"
BASE = f"https://api.telegram.org/bot{TOKEN}"
## Verificar Bot
r = requests.get(f"{BASE}/getMe")
print(r.json())
## Enviar Mensagem
r = requests.post(f"{BASE}/sendMessage", json={
"chat_id": "CHAT_ID",
"text": "Hello from pure HTTP!",
"parse_mode": "HTML"
})
print(r.json())
```
---
## Tipos De Mensagem
O Telegram suporta diversos tipos de conteudo. Todos os metodos aceitam `chat_id`, `reply_parameters` (para responder), `reply_markup` (para keyboards), `disable_notification` e `protect_content`.
## Html (Recomendado)
await bot.send_message(
chat_id=chat_id,
text="<b>Negrito</b>, <i>italico</i>, <code>codigo</code>, <a href='https://example.com'>link</a>",
parse_mode="HTML"
)
## Markdownv2 (Escapar Caracteres Especiais: _ * [ ] ( ) ~ ` > # + - = | { } . !)
await bot.send_message(
chat_id=chat_id,
text="*Negrito*, _italico_, `codigo`, [link](https://example\\.com)",
parse_mode="MarkdownV2"
)
```
## Foto (Por Url, File_Id Ou Upload)
await bot.send_photo(chat_id, photo="https://example.com/img.jpg", caption="Legenda aqui")
## Documento
await bot.send_document(chat_id, document=open("relatorio.pdf", "rb"), caption="Relatorio mensal")
## Video
await bot.send_video(chat_id, video="https://example.com/video.mp4", caption="Assista!")
## Audio
await bot.send_audio(chat_id, audio=open("musica.mp3", "rb"), title="Minha Musica")
## Voz (Ogg Com Opus)
await bot.send_voice(chat_id, voice=open("audio.ogg", "rb"))
## Localizacao
await bot.send_location(chat_id, latitude=-23.5505, longitude=-46.6333)
## Contato
await bot.send_contact(chat_id, phone_number="+5511999999999", first_name="Joao")
## Enquete
await bot.send_poll(
chat_id, question="Qual sua cor favorita?",
options=["Azul", "Verde", "Vermelho"],
is_anonymous=False
)
## Grupo De Midias
await bot.send_media_group(chat_id, media=[
InputMediaPhoto("url1", caption="Foto 1"),
InputMediaPhoto("url2"),
InputMediaVideo("url3")
])
## Acao De Chat (Typing, Upload_Photo, Etc.)
await bot.send_chat_action(chat_id, action="typing")
```
## Node.Js Equivalente
```typescript
// Foto
bot.sendPhoto(chatId, 'https://example.com/img.jpg', { caption: 'Legenda' });
// Documento
bot.sendDocument(chatId, fs.createReadStream('relatorio.pdf'), { caption: 'Relatorio' });
// Localizacao
bot.sendLocation(chatId, -23.5505, -46.6333);
// Enquete
bot.sendPoll(chatId, 'Qual sua cor favorita?', ['Azul', 'Verde', 'Vermelho']);
```
---
## Inline Keyboard (Botoes Dentro Da Mensagem)
```python
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("Opcao A", callback_data="opt_a"),
InlineKeyboardButton("Opcao B", callback_data="opt_b")],
[InlineKeyboardButton("Abrir Site", url="https://example.com")],
[InlineKeyboardButton("Compartilhar", switch_inline_query="texto")]
])
await bot.send_message(chat_id, "Escolha uma opcao:", reply_markup=keyboard)
## Handler De Callback
async def button_caRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.