Telegram extension for Gray Office.
A bot that brings the Gray Office finance assistant into Telegram. Send it a
question or a document; it forwards to the backend at
POST <GRAYOFFICE_URL>/api/bots/ingest, which does the AI routing — free text is
answered by the assistant, PDFs come back as structured JSON — and replies with
the result.
/ping— check responsiveness./help— what the bot can do./ask <question>— query the finance assistant./login— connect your Gray Office account. The bot shows a code and a button to open Gray Office; once you enter the code there, the message updates itself to ✅ Connected automatically. Linked messages are tied to your account./whoami— show which Gray Office account is connected./logout— disconnect your Gray Office account.
Send a PDF invoice/receipt and it comes back as structured JSON (with the
full result attached as a .json file). Send a .json document and it's
validated locally, then summarised by the assistant. Unsupported or oversized
files get a clear error prompt instead of failing silently.
-
Talk to @BotFather, run
/newbot, copy the token. -
Install dependencies:
python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
-
Copy
.env.exampleto.envand fill in:TELEGRAM_BOT_TOKEN— from BotFatherGRAYOFFICE_URL— where grayoffice runs (defaulthttp://localhost:5173)BOT_INGEST_TOKEN— must matchBOT_INGEST_TOKENin grayoffice's.dev.vars
python bot.py