Skip to content

Messaging integrations: Telegram & Discord bot support #50

Description

@setkyar

Problem / motivation

pi-web is currently browser-only. Users who want to interact with pi on the go (phone, tablet) or from within their team chat (Discord, Telegram) have no way to do so. pi could serve as a personal assistant that lives in messaging apps — answering questions, running commands, summarizing sessions, and staying context-aware via a shared working directory.

Proposed idea (high-level — TBD)

Allow pi-web to connect to Telegram and Discord as a bot, letting users interact with pi through direct messages or group channels.

Possible approach:

  • User provides a dedicated working folder (like a personal-assistant workspace) where pi operates.
  • pi-web runs the bot (Telegram Bot API via polling/webhook, Discord Bot via Gateway/Interactions).
  • Messages sent to the bot are forwarded to a pi RPC worker tied to that folder, preserving context across messages.
  • Responses stream back to the chat app (with thoughtful handling of long responses, code blocks, images).
  • Session transcripts from messaging are optionally visible in pi-web for review/search.

Open questions to resolve before scoping implementation:

  • How does authentication/authorization work per messaging user? (one pi-web instance, many users?)
  • Should each messaging user get their own pi session, or a shared session per bot?
  • How to handle pi's long-running tool calls and streaming output in messaging apps that expect shorter response times?
  • Folder context: is it one global folder per bot, or per-user subdirectories?
  • Commands vs. free-text: do we layer slash-commands (e.g., /summarize, /run) over natural language?
  • Rate limiting and abuse prevention when exposed to messaging platforms.

Inspiration: Personal AI assistants like ChatGPT on WhatsApp/Telegram, Claude on Slack, etc.

Scope (initial thoughts)

Layer What
Backend Bot connection lifecycle (start/stop per platform), message routing to pi RPC workers, webhook endpoints
Frontend Settings page section to configure Telegram bot token, Discord bot token, working folder, and per-platform toggles
Persistence Store bot configs and credentials in SQLite (encrypted tokens)

PR requirements (finalized later)

To be defined once the approach is settled.

  • E2E tests and screenshots showing the bot setup flow and a working message exchange.

Alternatives considered

  • External bridge services (n8n, Zapier) could relay messages to pi-web's chat API, but a first-class integration is simpler for end users.

Acknowledgement

  • I understand the maintainer triages requests and will invite a PR only if this moves forward.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions