# `ExGram.FSM.Key.ChatTopicUser`
[🔗](https://github.com/rockneurotiko/ex_gram_fsm/blob/v0.1.0/lib/ex_gram/fsm/key/chat_topic_user.ex#L1)

FSM key: `{chat_id, thread_id, user_id}`.

Scopes FSM state per-user per forum topic. This is the most granular scoping
available for Telegram groups with Topics (forum mode) enabled.

Each user gets their own independent FSM state within each forum topic, while
different topics remain completely isolated.

## Key shape

| Update type | Key |
|-------------|-----|
| Message in a forum topic | `{chat_id, thread_id, user_id}` |
| Message outside a topic | `{chat_id, 0, user_id}` — 0 is a sentinel for no-topic context |
| Channel post (no user) | `:error` — FSM state is skipped |
| Inline query (no chat) | `:error` — FSM state is skipped |

## Accessing thread_id

The `message_thread_id` field is read from:
1. `update.message.message_thread_id` — for regular messages
2. `update.callback_query.message.message_thread_id` — for callback queries

---

*Consult [api-reference.md](api-reference.md) for complete listing*
