Skip to content

wgtechlabs/devin-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Devin AI β€” Telegram Bot

GitHub Repo Banner

License: GPL v3 TypeScript Telegraf Node.js BunJS Docker Hub GitHub Packages

Devin AI β€” Telegram Bot is a self-hosted TypeScript integration that brings Devin AI into Telegram. Start a session from chat commands, continue the conversation in the same chat, and keep active session state persisted in PostgreSQL for restart recovery.

Deploy Your Own

Deploy on Railway

Deploy your own copy and support the project. πŸ’–

Features

  • Telegram Commands β€” /devin, /reply, /stop, /sessions, /template
  • In-Chat Continuation β€” Non-command text in a chat with an active session is forwarded to Devin
  • Adaptive Polling β€” Fast updates during early activity, then slower polling
  • Template Prompts β€” Built-in templates for common tasks
  • PR Notifications β€” Shares pull request URLs from Devin sessions
  • Restart Recovery β€” Active session state survives restarts via PostgreSQL
  • Customizable Bot Name β€” Set BOT_NAME to customize user-facing bot text
  • Self-Hosted β€” Full control of runtime and deployment

Tech Stack

Layer Technology
Language TypeScript 5.8+
Runtime Node.js 22+
Framework Telegraf v4
Toolchain Bun
Linter Biome
Testing Bun Test
Storage PostgreSQL (pg)

Prerequisites

  • Node.js 22+
  • Bun 1.0+
  • A Telegram bot token from @BotFather
  • A Devin API key (starts with apk_ or cog_)
  • PostgreSQL 14+ (for session persistence and restart recovery)

Quick Start

1. Install dependencies

git clone https://github.com/wgtechlabs/devin-telegram-bot.git
cd devin-telegram-bot
bun install

2. Configure environment

cp .env.example .env

Edit .env with your credentials:

TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
DATABASE_URL=postgres://postgres:postgres@localhost:5432/devin_telegram_bot

DEVIN_API_KEY=apk_your_devin_api_key_here
# Required when DEVIN_API_KEY starts with cog_
# DEVIN_ORG_ID=org_your_org_id_here

# Optional
# BOT_NAME=Devin
LOG_LEVEL=info

3. Run the bot

# Development (watch mode)
bun run dev

# Production
bun run build
bun run start

Usage

Commands

Command Description
/devin <task> Start a new Devin session
/reply <message> Send a follow-up message to the active session
/stop Terminate the active session in the chat
/sessions List all active tracked sessions
/template <id> <details> Start a session from a pre-built template

Templates

Template ID Description
open-pr Write code and open a pull request
code-review Review an existing pull request
write-tests Add test coverage
fix-bug Investigate and fix a bug

Architecture

src/
β”œβ”€β”€ index.ts
β”œβ”€β”€ config.ts
β”œβ”€β”€ commands/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ devin.ts
β”‚   β”œβ”€β”€ devin-reply.ts
β”‚   β”œβ”€β”€ devin-stop.ts
β”‚   β”œβ”€β”€ devin-sessions.ts
β”‚   └── devin-template.ts
β”œβ”€β”€ handlers/
β”‚   └── message.ts
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ devin-api.ts
β”‚   β”œβ”€β”€ logger.ts
β”‚   β”œβ”€β”€ session-manager.ts
β”‚   └── state-store.ts
β”œβ”€β”€ templates/
β”‚   └── index.ts
└── types/
    └── index.ts

Development

bun run lint
bun run typecheck
bun test
bun run build

Workflow

This project follows Clean Flow, Clean Commit, and Clean Labels conventions.

  • Branches: main (stable) + dev (integration) + feature branches
  • Branch Naming: Use feature/*, fix/*, docs/*, chore/*, test/*, refactor/*
  • Merge Strategy: feature/*, fix/*, docs/*, chore/*, test/*, refactor/* squash-merge into dev, dev merges into main
  • Commit Format: <emoji> <type>: <description> (see Clean Commit)
  • Labels: 21 standardized labels across 5 categories (see Clean Labels)

πŸ’¬ Community Discussions

Join our community discussions to get help, share ideas, and connect with other users:

  • πŸ“£ Announcements: Official updates from the maintainer
  • πŸ“Έ Showcase: Show and tell your implementation
  • πŸ’– Wall of Love: Share your experience with the bot
  • πŸ›Ÿ Help & Support: Get assistance from the community
  • 🧠 Ideas: Suggest new features and improvements

πŸ›Ÿ Help & Support

Need help? Check our Help & Support discussions or create a new issue.

🎯 Contributing

Important: Submit pull requests to the dev branch following the repository workflow.

Contributions are welcome! Your code must pass bun run typecheck before merging.

πŸ’– Sponsors

Like this project? Leave a star! ⭐⭐⭐⭐⭐

There are several ways you can support this project:

⭐ GitHub Star Nomination

Found this project helpful? Consider nominating me (@warengonzaga) for the GitHub Star program! This recognition supports ongoing development of this project and my other open-source projects. GitHub Stars are recognized for their significant contributions to the developer community β€” your nomination makes a difference and encourages continued innovation!

πŸ“ƒ License

This project is licensed under GPL-3.0-or-later.

πŸ“ Author

This project is created by Waren Gonzaga under WG Technology Labs, with the help of awesome contributors.

contributors


πŸ’»πŸ’–β˜• by Waren Gonzaga | YHWH πŸ™ - Without Him, none of this exists, even me.

About

Bring Devin AI software engineer to your Telegram

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors