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.
My role
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.
Key decision
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.
What it does
- You send a text message in Telegram
- Login to sci-bot.ru via REST (/api/login)
- Question sent over WebSocket; the bot waits for the full answer
- PDF generation with question + answer
- The file respuesta.pdf is sent back to the chat
Commands: /start for the welcome; any text is treated as a question.
Result
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.
Stack
- 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
Setup
Variables in .env:
- TELEGRAM_BOT_TOKEN
- SCIBOT_USERNAME / SCIBOT_PASSWORD
- ALLOWED_USER_ID - the only authorized user
Repository
Code on GitHub: grismaldo/scibot.telegram

