{"data":{"slug":"github-claude-office-skills-skills-telegram-bot-1293883ec171","title":"Telegram Bot Development for Automation and AI Integration","summary":"Build Telegram bots for chatbots, notifications, AI assistants, and group automation using n8n workflows and AI integration. Deliverables include functional bots with message handling, AI integration, and notification systems.","url":"https:\/\/skillshunter.net\/skills\/github-claude-office-skills-skills-telegram-bot-1293883ec171","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-claude-office-skills-skills-telegram-bot-1293883ec171","markdown_url":"https:\/\/skillshunter.net\/skills\/github-claude-office-skills-skills-telegram-bot-1293883ec171.md","download_url":"https:\/\/skillshunter.net\/skills\/github-claude-office-skills-skills-telegram-bot-1293883ec171\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"To get started, create a bot with @BotFather, obtain the API token, and extract the chat ID for the alerts channel. The setup requires n8n and access to AI models like GPT-4 for integration.","instructions":"---\nname: telegram-bot\ndescription: \"Telegram bot development - chatbots, notifications, AI assistants, and group automation\"\nversion: \"1.0.0\"\nauthor: claude-office-skills\nlicense: MIT\n\ncategory: messaging\ntags:\n  - telegram\n  - bot\n  - chatbot\n  - automation\n  - notifications\ndepartment: Engineering\n\nmodels:\n  recommended:\n    - claude-sonnet-4\n\nmcp:\n  server: telegram-mcp\n  tools:\n    - telegram_send_message\n    - telegram_get_updates\n    - telegram_send_photo\n\ncapabilities:\n  - bot_development\n  - message_handling\n  - ai_integration\n  - notification_system\n  - group_management\n\nlanguages:\n  - en\n  - zh\n\nrelated_skills:\n  - discord-bot\n  - whatsapp-automation\n  - ai-agent-builder\n  - slack-workflows\n---\n\n# Telegram Bot\n\nBuild Telegram bots for chatbots, notifications, AI assistants, and group automation. Based on n8n's Telegram workflow templates.\n\n## Overview\n\nThis skill covers:\n- Bot setup and configuration\n- Message handling patterns\n- AI-powered assistants\n- Notification workflows\n- Group automation\n\n---\n\n## Bot Setup\n\n### Creating a Bot\n\n```yaml\nsetup_steps:\n  1. create_bot:\n      - open: @BotFather on Telegram\n      - command: \/newbot\n      - provide: bot_name\n      - provide: bot_username (must end in 'bot')\n      - receive: API_token\n      \n  2. configure_bot:\n      - command: \/setdescription\n      - command: \/setabouttext\n      - command: \/setuserpic\n      - command: \/setcommands\n      \n  3. get_chat_id:\n      - start: conversation with bot\n      - call: https:\/\/api.telegram.org\/bot{TOKEN}\/getUpdates\n      - extract: chat.id from response\n```\n\n### Bot Commands\n\n```yaml\ncommands:\n  - command: \/start\n    description: \"Start the bot\"\n    \n  - command: \/help\n    description: \"Show available commands\"\n    \n  - command: \/status\n    description: \"Check system status\"\n    \n  - command: \/subscribe\n    description: \"Subscribe to notifications\"\n    \n  - command: \/unsubscribe\n    description: \"Unsubscribe from notifications\"\n```\n\n---\n\n## Message Handlers\n\n### Basic Message Handler\n\n```yaml\nworkflow: \"Telegram Message Handler\"\ntrigger: telegram_message\n\nhandlers:\n  text_message:\n    action: |\n      1. Parse message text\n      2. Determine intent\n      3. Process request\n      4. Send response\n      \n  command:\n    pattern: \"^\/\"\n    action: route_to_command_handler\n    \n  photo:\n    action: |\n      1. Download photo\n      2. Process with vision AI\n      3. Respond with analysis\n      \n  document:\n    action: |\n      1. Download document\n      2. Extract content\n      3. Process and respond\n      \n  voice:\n    action: |\n      1. Download audio\n      2. Transcribe with Whisper\n      3. Process text\n      4. Respond (text or voice)\n      \n  location:\n    action: |\n      1. Extract coordinates\n      2. Lookup local info\n      3. Respond with relevant data\n```\n\n### n8n Workflow\n\n```yaml\nworkflow: \"Telegram Bot n8n\"\n\nnodes:\n  - name: \"Telegram Trigger\"\n    type: \"n8n-nodes-base.telegramTrigger\"\n    parameters:\n      updates: [\"message\", \"callback_query\"]\n      \n  - name: \"Route Message Type\"\n    type: \"n8n-nodes-base.switch\"\n    parameters:\n      rules:\n        - output: 0\n          condition: \"{{ $json.message.text.startsWith('\/') }}\"\n        - output: 1\n          condition: \"{{ $json.message.photo }}\"\n        - output: 2\n          condition: \"{{ $json.message.voice }}\"\n        - output: 3\n          fallback: true\n          \n  - name: \"Process with AI\"\n    type: \"n8n-nodes-base.openAi\"\n    parameters:\n      model: \"gpt-4\"\n      messages:\n        - role: \"system\"\n          content: \"You are a helpful Telegram assistant.\"\n        - role: \"user\"\n          content: \"{{ $json.message.text }}\"\n          \n  - name: \"Send Response\"\n    type: \"n8n-nodes-base.telegram\"\n    parameters:\n      chatId: \"{{ $json.message.chat.id }}\"\n      text: \"{{ $json.response }}\"\n```\n\n---\n\n## AI-Powered Bot\n\n### GPT-4 Integration\n\n```yaml\nai_bot:\n  name: \"AI Assistant Bot\"\n  \n  system_prompt: |\n    You are a helpful AI assistant on Telegram.\n    \n    Guidelines:\n    - Be concise (Telegram has message limits)\n    - Use emojis appropriately\n    - Format with markdown when helpful\n    - Ask clarifying questions if needed\n    \n  features:\n    - conversational_memory: true\n    - context_window: last_10_messages\n    - tools: [web_search, calculator, weather]\n    \n  message_formatting:\n    max_length: 4096\n    split_long_messages: true\n    use_markdown: true\n```\n\n### Multi-Modal Bot\n\n```yaml\nmultimodal_bot:\n  handlers:\n    text:\n      model: gpt-4\n      action: chat_completion\n      \n    image:\n      model: gpt-4-vision\n      action: analyze_and_respond\n      \n    voice:\n      transcribe: whisper\n      process: gpt-4\n      respond: text_or_voice\n      \n    document:\n      extract: based_on_type\n      summarize: gpt-4\n      respond: text\n```\n\n---\n\n## Notification System\n\n### Alert Bot\n\n```yaml\nworkflow: \"System Alert Bot\"\n\ntriggers:\n  - source: monitoring_system\n    event: alert\n  - source: ci_cd\n    event: build_status\n  - source: ecommerce\n    event: new_order\n    \nnotification_templates:\n  alert:\n    format: |\n      \ud83d\udea8 *Alert: {severity}*\n      \n      *Service:* {service}\n      *Message:* {message}\n      *Time:* {timestamp}\n      \n      [View Dashboard]({dashboard_link})\n      \n  build:\n    format: |\n      {status_emoji} *Build {status}*\n      \n      *Project:* {project}\n      *Branch:* {branch}\n      *Commit:* `{commit_short}`\n      \n      {details}\n      \n  order:\n    format: |\n      \ud83d\uded2 *New Order!*\n      \n      *Order:* #{order_id}\n      *Customer:* {customer}\n      *Total:* ${total}\n      *Items:* {item_count}\n      \nrouting:\n  by_severity:\n    critical: [admin_group, on_call_user]\n    warning: [team_group]\n    info: [logging_channel]\n```\n\n### Scheduled Notifications\n\n```yaml\nscheduled_notifications:\n  daily_digest:\n    schedule: \"9am daily\"\n    template: |\n      \ud83d\udcca *Daily Summary - {date}*\n      \n      \ud83d\udcc8 Sales: ${sales} ({change})\n      \ud83d\udc65 New users: {new_users}\n      \ud83c\udfab Open tickets: {tickets}\n      \n      Have a great day! \u2600\ufe0f\n      \n  weekly_report:\n    schedule: \"Monday 9am\"\n    template: weekly_metrics_report\n    \n  reminder:\n    trigger: custom_event\n    template: |\n      \u23f0 *Reminder*\n      \n      {reminder_text}\n      \n      Scheduled by: {creator}\n```\n\n---\n\n## Group Automation\n\n### Welcome Bot\n\n```yaml\ngroup_bot:\n  on_member_join:\n    action: |\n      1. Check if new member\n      2. Send welcome message\n      3. Share rules\n      4. Suggest introduction\n      \n    template: |\n      \ud83d\udc4b Welcome to {group_name}, {user_name}!\n      \n      Please:\n      1. Read the \/rules\n      2. Introduce yourself\n      3. Ask questions anytime!\n      \n      Enjoy your stay! \ud83c\udf89\n      \n  on_member_leave:\n    action: optional_goodbye\n    \n  moderation:\n    - spam_detection: auto_delete + warn\n    - link_filtering: whitelist_only\n    - flood_control: rate_limit\n```\n\n### Poll & Survey Bot\n\n```yaml\npoll_bot:\n  commands:\n    \/poll:\n      format: \"\/poll Question | Option1 | Option2 | ...\"\n      action: create_poll\n      \n    \/survey:\n      action: start_multi_question_survey\n      \n    \/results:\n      action: show_aggregated_results\n      \n  features:\n    - anonymous_voting: optional\n    - multiple_choice: optional\n    - scheduled_close: optional\n    - export_results: to_sheets\n```\n\n---\n\n## Inline Features\n\n### Inline Keyboard\n\n```yaml\ninline_keyboard:\n  example:\n    text: \"Choose an option:\"\n    keyboard:\n      - row:\n          - text: \"Option 1\"\n            callback_data: \"opt_1\"\n          - text: \"Option 2\"\n            callback_data: \"opt_2\"\n      - row:\n          - text: \"Cancel\"\n            callback_data: \"cancel\"\n            \n  callback_handler:\n    opt_1:\n      action: process_option_1\n      response: \"You selected Option 1\"\n      \n    opt_2:\n      action: process_option_2\n      response: \"You selected Option 2\"\n      \n    cancel:\n      action: cancel_operation\n      response: \"Operation cancelled\"\n```\n\n### Inline Query\n\n```yaml\ninline_mode:\n  trigger: \"@botname query\"\n  \n  results:\n    - type: article\n      title: \"{query} result\"\n      description: \"Click to send\"\n      message_text: \"Result for: {query}\"\n      \n    - type: photo\n      photo_url: \"{search_result_image}\"\n      \n    - type: gif\n      gif_url: \"{gif_url}\"\n```\n\n---\n\n## Output Example\n\n**Request**: \"Create a Telegram notification bot for server alerts\"\n\n**Output**:\n\n```markdown\n# Server Alert Telegram Bot\n\n## Setup\n\n1. Create bot with @BotFather\n2. Get token: `123456:ABC-DEF...`\n3. Get chat ID for alerts channel\n\n## n8n Workflow\n\n```yaml\nnodes:\n  1. Webhook (receives alerts)\n  2. Format Message\n  3. Telegram Send\n```\n\n## Alert Templates\n\n**Critical Alert:**\n```\n\ud83d\udea8 CRITICAL ALERT\n\nServer: production-web-01\nStatus: DOWN\nTime: 2026-01-30 14:32:05 UTC\n\nDetails:\n- CPU: 98%\n- Memory: 95%\n- Disk: 89%\n\n[View Grafana] [Acknowledge]\n```\n\n**Recovery:**\n```\n\u2705 RECOVERED\n\nServer: production-web-01\nDowntime: 5 minutes\nStatus: All systems normal\n\nIncident resolved automatically.\n```\n\n## Implementation\n\n```javascript\n\/\/ Send alert function\nasync function sendAlert(severity, message, details) {\n  const emoji = {\n    critical: '\ud83d\udea8',\n    warning: '\u26a0\ufe0f',\n    info: '\u2139\ufe0f',\n    success: '\u2705'\n  };\n  \n  const text = `${emoji[severity]} *${severity.toUpperCase()}*\\n\\n${message}\\n\\n${details}`;\n  \n  await telegram.sendMessage({\n    chat_id: ALERT_CHANNEL_ID,\n    text: text,\n    parse_mode: 'Markdown'\n  });\n}\n```\n\n## Features\n- Severity-based routing\n- Inline action buttons\n- Acknowledgment tracking\n- Escalation rules\n```\n\n---\n\n*Telegram Bot Skill - Part of Claude Office Skills*\n","use_cases":["Build a chatbot that responds to user queries using GPT-4","Create a notification system for system alerts and build status updates","Develop an AI-powered assistant that handles text, voice, and image inputs"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/claude-office-skills\/skills\/blob\/9c4c7d5cd2813a8936bf2c9fdb174ea883b85a11\/telegram-bot\/SKILL.md","source_commit":"9c4c7d5cd2813a8936bf2c9fdb174ea883b85a11","license":"MIT","version":null,"listing_approved_at":"2026-11-22","created_at":"2026-11-21T15:21:46.000000Z","updated_at":"2026-11-22T11:18:24.000000Z","seo_title":"Telegram Bot Development for Automation","seo_description":"Create Telegram bots for notifications, AI assistants, and group automation with n8n and AI integration.","seo_keywords":["Telegram bot development","AI-powered Telegram bot","Telegram notification system","Telegram chatbot automation","Telegram AI assistant"]}}