> ## Documentation Index
> Fetch the complete documentation index at: https://safia.maximusolution.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SAFIA Telegram Bot Commands, Rate Limits & Chat Context

> Learn how to talk to SAFIA on Telegram — the two slash commands, daily rate limits, chat context window, and access control explained.

SAFIA is designed to feel like texting a knowledgeable friend — you don't need to memorise a list of commands or follow rigid syntax. Most of the time you simply type (or speak) a message and SAFIA takes care of the rest. Two slash commands exist for housekeeping tasks, and everything else is plain conversation.

## Slash commands

SAFIA only responds to two slash commands.

### `/start`

Sends a welcome message and **clears your current chat history**. Use it when you want to begin a fresh conversation — for example, after switching topics or if a previous session went off the rails.

```text theme={null}
/start
```

> Hi! I'm **SAFIA**, your personal finance chat companion.
>
> **What can I do?**
>
> * Track income, expenses, and investments (stocks, gold, crypto, etc.)
> * Check **prices** or **exchange rates** (e.g. gold today, Bitcoin, USD to IDR)
> * Help with **debt**, savings, financial news, education, and **reminders**
>
> **How to use?** Send text, voice, or a clear photo of a receipt/payslip.
>
> /start = restart conversation /help = quick info & limits
>
> Got questions? Just send a message 🙂

<Note>
  `/start` resets your **chat history** but does not delete your expenses, assets, or long-term memories. Your financial records stay safe.
</Note>

### `/help`

Shows a quick-reference help message with a summary of what SAFIA can receive and your current daily limits. Useful when you forget whether SAFIA accepts voice messages or need a reminder of the message cap.

```text theme={null}
/help
```

> **SAFIA Help**
>
> **Commands** /start — restart conversation /help — this message
>
> **Send**
>
> * **Text** — ask about money, investments, prices, exchange rates, etc.
> * **Voice** — transcribed to text, then answered like a regular chat
> * **Photo** — clear receipt or payslip (I'll read the contents)
>
> **Limit:** max **1000 messages per day** per account (resets daily).
>
> **Tip:** write amounts and dates clearly for accurate records.

## Natural language interaction

Every other interaction with SAFIA is just a normal message. There are no special keywords or rigid formats — write the way you would text a colleague.

<CardGroup cols={2}>
  <Card title="Track an expense" icon="receipt">
    "I spent 45k on coffee this morning"
  </Card>

  <Card title="Check a price" icon="chart-line">
    "What's the Bitcoin price right now?"
  </Card>

  <Card title="Review your finances" icon="magnifying-glass">
    "How much did I spend on food this month?"
  </Card>

  <Card title="Get advice" icon="lightbulb">
    "Should I rebalance my portfolio this week?"
  </Card>
</CardGroup>

You can write in **English or Bahasa Indonesia** — SAFIA always replies in whichever language you use.

## Real-time status messages

While SAFIA processes your request, it shows a live status message so you know what's happening. The message updates as SAFIA moves through each step — you never have to wonder whether it received your input.

| Status shown           | What SAFIA is doing                       |
| ---------------------- | ----------------------------------------- |
| `Listening...`         | Downloading your voice file from Telegram |
| `Thinking...`          | Calling the AI model and any needed tools |
| `Scanning document...` | Running vision extraction on your photo   |

Once finished, the status message is replaced with SAFIA's actual reply — so the chat stays clean with no extra noise.

## Rate limits

SAFIA allows **1000 messages per user per day**. The count resets at midnight UTC each day.

Each of the following counts as one message toward your daily limit:

* A text message
* A voice message (after transcription)
* A photo (after scanning)

When you reach the limit, SAFIA will tell you:

> You've reached the daily limit of 1000 messages. Please try again tomorrow, or reset the conversation if needed.

<Tip>
  If you're tracking expenses for multiple purchases, you can log several items in a single message — for example, "I spent 30k on transport, 80k on lunch, and 15k on snacks" — and SAFIA will record all three at once, using only one message from your quota.
</Tip>

## Chat context window

SAFIA remembers your **last 10 messages** within a session, kept in an in-memory cache and persisted to SQLite so the context survives a bot restart. This lets it follow the flow of a conversation — you can say "make it monthly instead" and SAFIA will understand what "it" refers to.

<Warning>
  The chat context expires after **2 hours of inactivity**. If you come back to a conversation after a long break, SAFIA will have forgotten the recent thread. Use `/start` to begin cleanly, or simply re-state any relevant context in your next message.
</Warning>

Context expiry affects only the short-term conversation thread. Your expenses, assets, reminders, and long-term memories are stored separately and are always available regardless of session age.

## Access control

Depending on how SAFIA is deployed, access may be **open to everyone** or **restricted to an allowlist** of approved Telegram user IDs. This is configured by the bot administrator in the admin dashboard.

If your account is not on the allowlist, SAFIA will respond with:

> Access denied — you are not authorised to use this bot.
>
> Your Telegram ID: `123456789`
>
> Share this ID with the bot owner to request access.

<Note>
  Copy the Telegram ID from that message and send it to the person who set up the bot. They can add you via the admin dashboard without any downtime.
</Note>
