# sk-lyf/discord-cricket-bot architecture

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

- Interactive diagram: https://gitdiagram.com/sk-lyf/discord-cricket-bot
- Repository: https://github.com/sk-lyf/discord-cricket-bot

## Overview

This small Python bot fetches the current cricket matches from CricAPI, formats the first match as a scorecard, and posts it to Discord. The shown entry point runs that sequence directly. The workflow file is listed in the tree but its contents are unavailable, so the trigger is not represented.

Main entry points: [`cricket_bot.py`](https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.py) (Script entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot["Bot runtime"]
  node_entry["Script entry point<br/>[cricket_bot.py]"]
  node_scores["Score retrieval<br/>[cricket_bot.py]"]
  node_delivery["Discord delivery<br/>[cricket_bot.py]"]
end

node_cricapi["CricAPI"]
node_discord["Discord webhook"]

node_entry -->|"fetches score"| node_scores
node_scores -->|"requests matches"| node_cricapi
node_scores -->|"returns scorecard"| node_entry
node_entry -->|"sends score"| node_delivery
node_delivery -->|"posts message"| node_discord

click node_entry "https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.py"
click node_scores "https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.py"
click node_delivery "https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.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_entry,node_scores,node_delivery toneBlue
class node_cricapi,node_discord toneMint
```

## Components

### Bot runtime

- [Script entry point](https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.py): `cricket_bot.py`
- [Score retrieval](https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.py): `cricket_bot.py`
- [Discord delivery](https://github.com/sk-lyf/discord-cricket-bot/blob/main/cricket_bot.py): `cricket_bot.py`

### Other components

- **CricAPI**
- **Discord webhook**

## Connections

- Script entry point → Score retrieval: fetches score (evidence: `cricket_bot.py`)
- Score retrieval → CricAPI: requests matches (evidence: `cricket_bot.py`)
- Score retrieval → Script entry point: returns scorecard (evidence: `cricket_bot.py`)
- Script entry point → Discord delivery: sends score (evidence: `cricket_bot.py`)
- Discord delivery → Discord webhook: posts message (evidence: `cricket_bot.py`)
