# default-dark/ipinfo architecture

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

- Interactive diagram: https://gitdiagram.com/default-dark/ipinfo
- Repository: https://github.com/default-dark/ipinfo

## Overview

ipinfo is a small Telegram bot for looking up the sender’s public IP or querying details for a supplied IP. Both commands request JSON from ipinfo.io, format the returned network and location fields, and send the result back in Telegram. The README and sole source file support this compact map; no separate storage layer is present.

Main entry points: [`ipinfo.py`](https://github.com/default-dark/ipinfo/blob/main/ipinfo.py) (Command handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_telegram["Telegram bot"]
  node_bot["Command handlers<br/>[ipinfo.py]"]
  node_prompt["GeoIP prompt<br/>[ipinfo.py]"]
end

subgraph group_lookup["IP lookup"]
  node_format["Result formatting<br/>[ipinfo.py]"]
end

node_user(("Telegram user"))
node_ipinfo["ipinfo.io API"]
node_telegram_service["Telegram API"]

node_user -->|"sends commands"| node_bot
node_bot -->|"requests IP"| node_prompt
node_prompt -->|"prompts for address"| node_user
node_user -->|"submits address"| node_bot
node_bot -->|"fetches IP data"| node_ipinfo
node_ipinfo -->|"returns JSON"| node_format
node_bot -->|"formats lookup"| node_format
node_format -->|"sends result"| node_telegram_service
node_telegram_service -->|"delivers messages"| node_user
node_bot -->|"polls updates"| node_telegram_service

click node_bot "https://github.com/default-dark/ipinfo/blob/main/ipinfo.py"
click node_prompt "https://github.com/default-dark/ipinfo/blob/main/ipinfo.py"
click node_format "https://github.com/default-dark/ipinfo/blob/main/ipinfo.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_prompt,node_user toneBlue
class node_format toneAmber
class node_ipinfo,node_telegram_service toneMint
```

## Components

### Telegram bot

- [Command handlers](https://github.com/default-dark/ipinfo/blob/main/ipinfo.py): `ipinfo.py`
- [GeoIP prompt](https://github.com/default-dark/ipinfo/blob/main/ipinfo.py): `ipinfo.py`

### IP lookup

- [Result formatting](https://github.com/default-dark/ipinfo/blob/main/ipinfo.py): `ipinfo.py`

### Other components

- **Telegram user**
- **ipinfo.io API**
- **Telegram API**

## Connections

- Telegram user → Command handlers: sends commands (evidence: `ipinfo.py`)
- Command handlers → GeoIP prompt: requests IP (evidence: `ipinfo.py`)
- GeoIP prompt → Telegram user: prompts for address (evidence: `ipinfo.py`)
- Telegram user → Command handlers: submits address (evidence: `ipinfo.py`)
- Command handlers → ipinfo.io API: fetches IP data (evidence: `ipinfo.py`)
- ipinfo.io API → Result formatting: returns JSON (evidence: `ipinfo.py`)
- Command handlers → Result formatting: formats lookup (evidence: `ipinfo.py`)
- Result formatting → Telegram API: sends result (evidence: `ipinfo.py`)
- Telegram API → Telegram user: delivers messages
- Command handlers → Telegram API: polls updates (evidence: `ipinfo.py`)
