# ic-song/hoibot architecture

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

- Interactive diagram: https://gitdiagram.com/ic-song/hoibot
- Repository: https://github.com/ic-song/hoibot

## Overview

hoiBot is a KakaoTalk game-operations bot running in an Android JavaScript messenger-bot environment. Users send chat commands; the bot processes them and replies with game information or outcomes, while reading and writing operational data under `/sdcard/호이랜드/`. The README identifies the main.js capabilities; the excerpts also show Info.js lookup handlers and miniGameBot’s Crocodile game and win-stat persistence. Main.js was not sampled, so its domain branches and data access are based on README statements, not inspected implementation details.

Main entry points: [`main.js`](https://github.com/ic-song/hoibot/blob/main/main.js) (Main commands), [`Info.js`](https://github.com/ic-song/hoibot/blob/main/Info.js) (Info lookups), [`data/miniGameBot.js`](https://github.com/ic-song/hoibot/blob/main/data/miniGameBot.js) (Mini-game handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot handlers"]
  node_main["Main commands<br/>[main.js]"]
  node_info["Info lookups<br/>[Info.js]"]
  node_mini["Mini-game handler<br/>[miniGameBot.js]"]
end

subgraph group_domains["Game capabilities"]
  node_members["Member data<br/>[main.js]"]
  node_pets["Pet features<br/>[main.js]"]
  node_guild["Guild features<br/>[main.js]"]
  node_towers["Tower challenges<br/>[main.js]"]
  node_castle["Castle battle<br/>[main.js]"]
  node_boards["Community boards<br/>[main.js]"]
  node_items["Items<br/>[main.js]"]
  node_requests["Request monitoring<br/>[main.js]"]
  node_croc["Crocodile game<br/>[miniGameBot.js]"]
end

subgraph group_persistence["Data and state"]
  node_operational[("Operational files")]
  node_minigame_data[("Mini-game stats")]
end

node_users(("Chat users"))

node_users -->|"send commands"| node_main
node_users -->|"request details"| node_info
node_users -->|"play commands"| node_mini
node_main -->|"handles"| node_members
node_main -->|"handles"| node_pets
node_main -->|"handles"| node_guild
node_main -->|"handles"| node_towers
node_main -->|"handles"| node_castle
node_main -->|"handles"| node_boards
node_main -->|"handles"| node_items
node_main -->|"handles"| node_requests
node_info -->|"looks up"| node_members
node_info -->|"looks up"| node_pets
node_info -->|"loads data"| node_operational
node_main -->|"reads and writes"| node_operational
node_mini -->|"handles turns"| node_croc
node_mini -->|"loads and saves"| node_minigame_data

click node_main "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_info "https://github.com/ic-song/hoibot/blob/main/Info.js"
click node_mini "https://github.com/ic-song/hoibot/blob/main/data/miniGameBot.js"
click node_members "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_pets "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_guild "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_towers "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_castle "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_boards "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_items "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_requests "https://github.com/ic-song/hoibot/blob/main/main.js"
click node_croc "https://github.com/ic-song/hoibot/blob/main/data/miniGameBot.js"

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_main,node_info,node_mini,node_users toneBlue
class node_members,node_pets,node_guild,node_towers,node_castle,node_boards,node_items,node_requests,node_croc toneAmber
class node_operational,node_minigame_data toneMint
```

## Components

### Bot handlers

- [Main commands](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Info lookups](https://github.com/ic-song/hoibot/blob/main/Info.js): `Info.js`
- [Mini-game handler](https://github.com/ic-song/hoibot/blob/main/data/miniGameBot.js): `data/miniGameBot.js`

### Game capabilities

- [Member data](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Pet features](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Guild features](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Tower challenges](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Castle battle](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Community boards](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Items](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Request monitoring](https://github.com/ic-song/hoibot/blob/main/main.js): `main.js`
- [Crocodile game](https://github.com/ic-song/hoibot/blob/main/data/miniGameBot.js): `data/miniGameBot.js`

### Data and state

- **Operational files**
- **Mini-game stats**

### Other components

- **Chat users**

## Connections

- Chat users → Main commands: send commands (evidence: `README.md`)
- Chat users → Info lookups: request details (evidence: `Info.js`)
- Chat users → Mini-game handler: play commands (evidence: `data/miniGameBot.js`)
- Main commands → Member data: handles (evidence: `README.md`)
- Main commands → Pet features: handles (evidence: `README.md`)
- Main commands → Guild features: handles (evidence: `README.md`)
- Main commands → Tower challenges: handles (evidence: `README.md`)
- Main commands → Castle battle: handles (evidence: `README.md`)
- Main commands → Community boards: handles (evidence: `README.md`)
- Main commands → Items: handles (evidence: `README.md`)
- Main commands → Request monitoring: handles (evidence: `README.md`)
- Info lookups → Member data: looks up (evidence: `Info.js`)
- Info lookups → Pet features: looks up (evidence: `Info.js`)
- Info lookups → Operational files: loads data (evidence: `Info.js`)
- Main commands → Operational files: reads and writes (evidence: `README.md`)
- Mini-game handler → Crocodile game: handles turns (evidence: `data/miniGameBot.js`)
- Mini-game handler → Mini-game stats: loads and saves (evidence: `data/miniGameBot.js`)
