# oberwissen/dcoffin architecture

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

- Interactive diagram: https://gitdiagram.com/oberwissen/dcoffin
- Repository: https://github.com/oberwissen/dcoffin

## Overview

dcoffin is a terminal-based Discord multi-tool. Its principal workflow takes a message and delay from the user, reads token and channel lists, then runs per-token/per-channel message workers; workers send to Discord and handle rate limits and invalid-token responses. Separate menu workflows check tokens, display account information, and remove invalid tokens. The README also documents localization and self-updating. Paths and edges reflect the excerpts and tree; unsampled wiring, including utility helpers, is omitted.

Main entry points: [`main.py`](https://github.com/oberwissen/dcoffin/blob/main/main.py) (Menu and workflows), [`util/token_checker.py`](https://github.com/oberwissen/dcoffin/blob/main/util/token_checker.py) (Token checker), [`util/token_info.py`](https://github.com/oberwissen/dcoffin/blob/main/util/token_info.py) (Account lookup), [`DSECTOR.py`](https://github.com/oberwissen/dcoffin/blob/main/DSECTOR.py) (Terminal utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Terminal workflows"]
  node_app["Menu and workflows<br/>[main.py]"]
  node_terminal["Terminal utilities<br/>[DSECTOR.py]"]
end

subgraph group_discord["Discord operations"]
  node_tokens["Token list<br/>[tokens.txt]"]
  node_channels["Channel IDs<br/>[channel_ids.txt]"]
  node_checker["Token checker<br/>[token_checker.py]"]
  node_account["Account lookup<br/>[token_info.py]"]
end

subgraph group_locale["Localization"]
  node_language_choice["Language selection<br/>[selected.py]"]
  node_english["English strings<br/>[english.py]"]
  node_turkish["Turkish strings<br/>[turkish.py]"]
end

subgraph group_update["Update and state"]
  node_language_state["Language state<br/>[lang.txt]"]
  node_first_run["First-run state<br/>[is_first_time.txt]"]
  node_revision["Revision metadata<br/>[projekt.py]"]
  node_update_archive["Update archive<br/>[sec.zip]"]
end

node_user(("Operator"))
node_discord_api{{"Discord API"}}
node_update_host{{"Update host"}}

node_user -->|"selects workflow"| node_app
node_app -->|"uses terminal helpers"| node_terminal
node_app -->|"reads and rewrites"| node_tokens
node_app -->|"reads"| node_channels
node_app -->|"posts threaded messages"| node_discord_api
node_app -->|"checks each token"| node_checker
node_checker -->|"validates token"| node_discord_api
node_app -->|"requests account info"| node_account
node_account -->|"fetches profile"| node_discord_api
node_app -->|"sets selected language"| node_language_choice
node_app -->|"reads and writes"| node_language_state
node_app -->|"loads strings"| node_english
node_app -->|"loads strings"| node_turkish
node_app -->|"reads and preserves"| node_first_run
node_app -->|"checks revision"| node_revision
node_app -->|"checks and downloads update"| node_update_host
node_update_host -.->|"provides package"| node_update_archive

click node_app "https://github.com/oberwissen/dcoffin/blob/main/main.py"
click node_terminal "https://github.com/oberwissen/dcoffin/blob/main/DSECTOR.py"
click node_tokens "https://github.com/oberwissen/dcoffin/blob/main/discord/tokens.txt"
click node_channels "https://github.com/oberwissen/dcoffin/blob/main/discord/channel_ids.txt"
click node_checker "https://github.com/oberwissen/dcoffin/blob/main/util/token_checker.py"
click node_account "https://github.com/oberwissen/dcoffin/blob/main/util/token_info.py"
click node_language_choice "https://github.com/oberwissen/dcoffin/blob/main/LANG/selected.py"
click node_english "https://github.com/oberwissen/dcoffin/blob/main/LANG/english.py"
click node_turkish "https://github.com/oberwissen/dcoffin/blob/main/LANG/turkish.py"
click node_language_state "https://github.com/oberwissen/dcoffin/blob/main/OBER/lang.txt"
click node_first_run "https://github.com/oberwissen/dcoffin/blob/main/OBER/is_first_time.txt"
click node_revision "https://github.com/oberwissen/dcoffin/blob/main/projekt.py"
click node_update_archive "https://github.com/oberwissen/dcoffin/blob/main/ota/sec.zip"

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_app,node_terminal toneBlue
class node_tokens,node_channels,node_checker,node_account toneAmber
class node_language_choice,node_english,node_turkish,node_discord_api toneMint
class node_language_state,node_first_run,node_revision,node_update_archive toneRose
class node_user,node_update_host toneIndigo
```

## Components

### Terminal workflows

- [Menu and workflows](https://github.com/oberwissen/dcoffin/blob/main/main.py): `main.py`
- [Terminal utilities](https://github.com/oberwissen/dcoffin/blob/main/DSECTOR.py): `DSECTOR.py`

### Discord operations

- [Token list](https://github.com/oberwissen/dcoffin/blob/main/discord/tokens.txt): `discord/tokens.txt`
- [Channel IDs](https://github.com/oberwissen/dcoffin/blob/main/discord/channel_ids.txt): `discord/channel_ids.txt`
- [Token checker](https://github.com/oberwissen/dcoffin/blob/main/util/token_checker.py): `util/token_checker.py`
- [Account lookup](https://github.com/oberwissen/dcoffin/blob/main/util/token_info.py): `util/token_info.py`

### Localization

- [Language selection](https://github.com/oberwissen/dcoffin/blob/main/LANG/selected.py): `LANG/selected.py`
- [English strings](https://github.com/oberwissen/dcoffin/blob/main/LANG/english.py): `LANG/english.py`
- [Turkish strings](https://github.com/oberwissen/dcoffin/blob/main/LANG/turkish.py): `LANG/turkish.py`

### Update and state

- [Language state](https://github.com/oberwissen/dcoffin/blob/main/OBER/lang.txt): `OBER/lang.txt`
- [First-run state](https://github.com/oberwissen/dcoffin/blob/main/OBER/is_first_time.txt): `OBER/is_first_time.txt`
- [Revision metadata](https://github.com/oberwissen/dcoffin/blob/main/projekt.py): `projekt.py`
- [Update archive](https://github.com/oberwissen/dcoffin/blob/main/ota/sec.zip): `ota/sec.zip`

### Other components

- **Operator**
- **Discord API**
- **Update host**

## Connections

- Operator → Menu and workflows: selects workflow
- Menu and workflows → Terminal utilities: uses terminal helpers
- Menu and workflows → Token list: reads and rewrites
- Menu and workflows → Channel IDs: reads
- Menu and workflows → Discord API: posts threaded messages
- Menu and workflows → Token checker: checks each token
- Token checker → Discord API: validates token
- Menu and workflows → Account lookup: requests account info
- Account lookup → Discord API: fetches profile
- Menu and workflows → Language selection: sets selected language
- Menu and workflows → Language state: reads and writes
- Menu and workflows → English strings: loads strings
- Menu and workflows → Turkish strings: loads strings
- Menu and workflows → First-run state: reads and preserves
- Menu and workflows → Revision metadata: checks revision
- Menu and workflows → Update host: checks and downloads update
- Update host → Update archive: provides package
