grismaldo
ES

Projects

scibot.telegram

June 10, 2026

Personal Telegram bot that queries sci-bot.ru and returns the answer as a PDF.

scibot.telegram

scibot.telegram is a Telegram bot that acts as a bridge to sci-bot.ru: you send a question in chat, the bot queries the API, and it returns the full answer as a PDF.

Built for personal use, with access restricted by Telegram ID and credentials in .env.

I built the bot and the full integration between Telegram and sci-bot.ru: authentication, real-time communication, waiting for the answer, document generation, and sending it back to the chat.

I chose Telegram as the interface to avoid building another app and to turn a multi-step query into a single conversation. Access stays restricted by ID, and credentials stay out of the code.

  1. You send a text message in Telegram
  2. Login to sci-bot.ru via REST (/api/login)
  3. Question sent over WebSocket; the bot waits for the full answer
  4. PDF generation with question + answer
  5. The file respuesta.pdf is sent back to the chat

Commands: /start for the welcome; any text is treated as a question.

The result is a reproducible personal tool: a question sent in chat ends as a readable PDF in the same thread. The project is documented and available as open source.

  • Python 3.10+
  • python-telegram-bot - polling and handlers
  • websockets - real-time chat with sci-bot.ru
  • requests - HTTP authentication
  • fpdf2 - PDF export
  • python-dotenv - environment configuration

Variables in .env:

  • TELEGRAM_BOT_TOKEN
  • SCIBOT_USERNAME / SCIBOT_PASSWORD
  • ALLOWED_USER_ID - the only authorized user

Code on GitHub: grismaldo/scibot.telegram