mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-19 12:11:02 -04:00
[PR #283] feat: add Telegram bot integration #295
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/283
Author: @freddycodes23
Created: 4/23/2026
Status: 🔄 Open
Base:
main← Head:feat/telegram-bot📝 Commits (1)
63d094afeat: add Telegram bot integration📊 Changes
4 files changed (+208 additions, -0 deletions)
View changed files
➕
pkg/telegram/auth.go(+17 -0)➕
pkg/telegram/bot.go(+59 -0)➕
pkg/telegram/formatter.go(+44 -0)➕
pkg/telegram/handler.go(+88 -0)📄 Description
Description of the Change
Problem
PentAGI has no mobile-friendly access method. Users must use a browser to access the web UI,
which is cumbersome on mobile devices and requires managing SSL certificate warnings.
The env vars
TELEGRAM_BOT_TOKEN,TELEGRAM_ENABLED,TELEGRAM_ALLOWED_USER_IDSandTELEGRAM_POLLINGexist in the installer but are never consumed by the application binary.Solution
Implements a Telegram bot integration in a new
pkg/telegrampackage that runs as a goroutinealongside the existing HTTP server. Users whitelisted by Telegram user ID can create flows,
check status, and control agents directly from the Telegram mobile app using simple commands.
Closes #
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
TELEGRAM_BOT_TOKEN,TELEGRAM_ENABLED=true,TELEGRAM_ALLOWED_USER_IDS,TELEGRAM_POLLING=trueto.envTELEGRAM_*vars to theenvironment:block indocker-compose.ymldocker compose up -d --force-recreate pentagi@Fr22dybot, send/start/helpto verify command list appears/new scan for open portsto verify flow creation/flowsto verify flow appears in list/status <flow_id>to verify status responseTest Results
Telegram bot authorized as @Fr22dybotSecurity Considerations
TELEGRAM_ALLOWED_USER_IDS—all other users are silently ignored and logged
auth.goPerformance Impact
Documentation Updates
Deployment Notes
Four new environment variables must be set to enable the bot. If
TELEGRAM_ENABLEDisfalseor unset, the bot goroutine does not start and there is zero overhead.
These must also be added to the
environment:block indocker-compose.yml:No database migrations required. No breaking changes to existing deployments.
Checklist
Code Quality
go fmtandgo vet(for Go code)npm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
This PR activates env vars (
TELEGRAM_BOT_TOKENetc.) that the PentAGI installer alreadygenerates but the binary never consumed. The implementation uses the well-maintained
go-telegram-bot-api/telegram-bot-api/v5library. Unit tests will be added in a follow-upPR once the maintainers confirm the interface design aligns with internal service conventions.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.