# sakexyz/tree_bot architecture

> Architecture diagram of the GitHub repository sakexyz/tree_bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakexyz/tree_bot
- Repository: https://github.com/sakexyz/tree_bot
- Video tour (about a minute): https://gitdiagram.com/sakexyz/tree_bot/video

## Overview

This is a small Telegram support bot: users start or request instructions, submit a formatted issue, receive an acknowledgement, and have the message forwarded to a support group while a Trello card is created in the department's list. The runtime is concentrated in main.py; README capabilities not sampled separately are represented only where supported by that file. The routing group ID, Trello endpoint, and configuration are environment-provided or hard-coded, so they are shown as external dependencies.

Main entry points: [`main.py`](https://github.com/sakexyz/tree_bot/blob/master/main.py) (Bot runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Telegram interaction"]
  node_bot["Bot runtime<br/>[main.py]"]
  node_start["Start welcome<br/>[main.py]"]
  node_instructions["Instructions<br/>[main.py]"]
  node_submit["Message handler<br/>[main.py]"]
  node_ack["Submission acknowledgement<br/>[main.py]"]
end

subgraph group_processing["Request processing"]
  node_parse["Department parsing<br/>[main.py]"]
  node_timestamp["Timestamp generation<br/>[main.py]"]
  node_card["Card creation<br/>[main.py]"]
end

subgraph group_integrations["External services"]
  node_telegram["Telegram API"]
  node_support(("Support group"))
  node_trello["Trello API"]
  node_lists[("Department lists")]
end

node_user(("Telegram user"))

node_user -->|"sends message"| node_telegram
node_telegram -->|"dispatches updates"| node_bot
node_bot -->|"handles start"| node_start
node_bot -->|"handles button"| node_instructions
node_bot -->|"handles message"| node_submit
node_start -->|"sends welcome"| node_telegram
node_instructions -->|"sends guidance"| node_telegram
node_submit -->|"forwards message"| node_support
node_submit -->|"sends acknowledgement"| node_ack
node_ack -->|"sends video"| node_telegram
node_submit -->|"passes text"| node_parse
node_parse -->|"requests timestamp"| node_timestamp
node_parse -->|"builds card data"| node_card
node_card -->|"creates card"| node_trello
node_card -->|"selects list"| node_lists

click node_bot "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_start "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_instructions "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_submit "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_ack "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_parse "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_timestamp "https://github.com/sakexyz/tree_bot/blob/master/main.py"
click node_card "https://github.com/sakexyz/tree_bot/blob/master/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bot,node_start,node_instructions,node_submit,node_ack,node_user toneBlue
class node_parse,node_timestamp,node_card toneAmber
class node_telegram,node_support,node_trello,node_lists toneMint
```

## Components

### Telegram interaction

- [Bot runtime](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`
- [Start welcome](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`
- [Instructions](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`
- [Message handler](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`
- [Submission acknowledgement](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`

### Request processing

- [Department parsing](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`
- [Timestamp generation](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`
- [Card creation](https://github.com/sakexyz/tree_bot/blob/master/main.py): `main.py`

### External services

- **Telegram API**
- **Support group**
- **Trello API**
- **Department lists**

### Other components

- **Telegram user**

## Connections

- Telegram user → Telegram API: sends message
- Telegram API → Bot runtime: dispatches updates
- Bot runtime → Start welcome: handles start
- Bot runtime → Instructions: handles button
- Bot runtime → Message handler: handles message
- Start welcome → Telegram API: sends welcome
- Instructions → Telegram API: sends guidance
- Message handler → Support group: forwards message
- Message handler → Submission acknowledgement: sends acknowledgement
- Submission acknowledgement → Telegram API: sends video
- Message handler → Department parsing: passes text
- Department parsing → Timestamp generation: requests timestamp
- Department parsing → Card creation: builds card data
- Card creation → Trello API: creates card
- Card creation → Department lists: selects list
