Skip to content

About

Telegram bot powered by Claude AI — inline queries, conversation memory, slash commands, webhook deploy

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

telegram-ai-bot

Telegram bot powered by Claude AI with conversation memory, inline queries, and command handling.

TypeScript Claude License

Features

  • AI Chat — Powered by Claude claude-sonnet-4-6 with streaming responses
  • Memory — Per-user conversation history stored in Redis
  • Commands — /start, /help, /clear, /settings
  • Inline Mode — Answer queries from any chat without adding the bot
  • Webhook — Deploy on any HTTPS server or serverless platform

Stack

Runtime     Node.js 20 + TypeScript
AI          Anthropic Claude API (@anthropic-ai/sdk)
Bot         Telegraf v4
Memory      Redis (ioredis)
Deploy      Webhook via Express + Vercel / Railway

Quick Start

git clone https://github.com/wpalish/telegram-ai-bot
cd telegram-ai-bot
npm install
cp .env.example .env
npm run dev

Environment Variables

TELEGRAM_BOT_TOKEN=your_bot_token_from_botfather
ANTHROPIC_API_KEY=your_anthropic_api_key
REDIS_URL=redis://localhost:6379
WEBHOOK_URL=https://your-domain.com/webhook
PORT=3000

Bot Commands

Command Description
/start Welcome message
/help List available commands
/clear Clear conversation history
/settings Toggle response mode (streaming/complete)

Architecture

src/
├── bot.ts          # Telegraf bot setup + webhook
├── handlers/
│   ├── message.ts  # Text message handler with Claude
│   ├── commands.ts # /start, /help, /clear, /settings
│   └── inline.ts   # Inline query handler
├── services/
│   ├── claude.ts   # Anthropic API wrapper with streaming
│   └── memory.ts   # Redis conversation history
└── index.ts        # Entry point

License

MIT

About

Telegram bot powered by Claude AI — inline queries, conversation memory, slash commands, webhook deploy

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages