# mindcleanser/mindcleanser architecture

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

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

## Overview

This is a CommandKit/Discord.js bot presenting mental-health resources and bot information through slash commands. Users choose a command and whether its response is private; handlers build Discord component messages with resource details or links. The main branches cover resource organizations, bot/community links, and contributor information. A client-ready hook updates bot activity and posts command information to Discord Bot List. CommandKit’s command dispatch and event registration are not shown, so those initiating links are unverified; the README provides no additional product capabilities.

Main entry points: [`config.json`](https://github.com/mindcleanser/mindcleanser/blob/master/config.json) (Bot link settings), [`src/app/commands/nami.js`](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/nami.js) (NAMI resources), [`src/app/commands/trevorproj.js`](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/trevorproj.js) (Trevor Project), [`src/app/commands/transll.js`](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/transll.js) (Trans Lifeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_client["Discord client<br/>[app.ts]"]
end

subgraph group_resources["Mental health resources"]
  node_nami["NAMI resources<br/>[nami.js]"]
  node_trevor["Trevor Project<br/>[trevorproj.js]"]
  node_translifeline["Trans Lifeline<br/>[transll.js]"]
end

subgraph group_links["Bot and community links"]
  node_help["Help overview<br/>[help.js]"]
  node_github["GitHub link<br/>[github.js]"]
  node_invite["Bot invite<br/>[invite.js]"]
  node_support["Support server<br/>[support-server.js]"]
  node_vote["Voting links<br/>[vote.js]"]
end

subgraph group_operations["Bot operations"]
  node_contributors["Contributor list<br/>[contrib.js]"]
  node_contribdata["Contributor data<br/>[contrib.json]"]
  node_ping["Ping command<br/>[ping.js]"]
  node_lifecycle["Client-ready tasks<br/>[logs.js]"]
  node_settings["Bot link settings<br/>[config.json]"]
end

node_user(("Discord user"))
node_discord(("Discord platform"))
node_dbl(("Discord Bot List"))

node_client -->|"creates client"| node_discord
node_user -.->|"invokes &#40;unverified&#41;"| node_nami
node_user -.->|"invokes &#40;unverified&#41;"| node_trevor
node_user -.->|"invokes &#40;unverified&#41;"| node_translifeline
node_user -.->|"invokes &#40;unverified&#41;"| node_help
node_user -.->|"invokes &#40;unverified&#41;"| node_github
node_user -.->|"invokes &#40;unverified&#41;"| node_invite
node_user -.->|"invokes &#40;unverified&#41;"| node_support
node_user -.->|"invokes &#40;unverified&#41;"| node_vote
node_user -.->|"invokes &#40;unverified&#41;"| node_contributors
node_user -.->|"invokes &#40;unverified&#41;"| node_ping
node_nami -->|"replies"| node_discord
node_trevor -->|"replies"| node_discord
node_translifeline -->|"replies"| node_discord
node_help -->|"replies"| node_discord
node_github -->|"replies"| node_discord
node_invite -->|"replies"| node_discord
node_support -->|"replies"| node_discord
node_vote -->|"replies"| node_discord
node_contributors -->|"replies"| node_discord
node_contributors -->|"reads"| node_contribdata
node_nami -->|"reads links"| node_settings
node_trevor -->|"reads links"| node_settings
node_translifeline -->|"reads links"| node_settings
node_help -->|"reads links"| node_settings
node_github -->|"reads links"| node_settings
node_invite -->|"reads links"| node_settings
node_support -->|"reads links"| node_settings
node_vote -->|"reads links"| node_settings
node_lifecycle -->|"updates activity"| node_discord
node_lifecycle -->|"posts bot data"| node_dbl

click node_client "https://github.com/mindcleanser/mindcleanser/blob/master/src/app.ts"
click node_nami "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/nami.js"
click node_trevor "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/trevorproj.js"
click node_translifeline "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/transll.js"
click node_help "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/help.js"
click node_github "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/github.js"
click node_invite "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/invite.js"
click node_support "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/support-server.js"
click node_vote "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/vote.js"
click node_contributors "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/contrib.js"
click node_contribdata "https://github.com/mindcleanser/mindcleanser/blob/master/contrib.json"
click node_ping "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/ping.js"
click node_lifecycle "https://github.com/mindcleanser/mindcleanser/blob/master/src/app/events/clientReady/logs.js"
click node_settings "https://github.com/mindcleanser/mindcleanser/blob/master/config.json"

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_client,node_user toneBlue
class node_nami,node_trevor,node_translifeline toneAmber
class node_help,node_github,node_invite,node_support,node_vote toneMint
class node_contributors,node_contribdata,node_ping,node_lifecycle,node_settings toneRose
class node_discord,node_dbl toneIndigo
```

## Components

### Bot runtime

- [Discord client](https://github.com/mindcleanser/mindcleanser/blob/master/src/app.ts): `src/app.ts`

### Mental health resources

- [NAMI resources](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/nami.js): `src/app/commands/nami.js`
- [Trevor Project](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/trevorproj.js): `src/app/commands/trevorproj.js`
- [Trans Lifeline](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/transll.js): `src/app/commands/transll.js`

### Bot and community links

- [Help overview](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/help.js): `src/app/commands/help.js`
- [GitHub link](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/github.js): `src/app/commands/github.js`
- [Bot invite](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/invite.js): `src/app/commands/invite.js`
- [Support server](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/support-server.js): `src/app/commands/support-server.js`
- [Voting links](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/vote.js): `src/app/commands/vote.js`

### Bot operations

- [Contributor list](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/contrib.js): `src/app/commands/contrib.js`
- [Contributor data](https://github.com/mindcleanser/mindcleanser/blob/master/contrib.json): `contrib.json`
- [Ping command](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/commands/ping.js): `src/app/commands/ping.js`
- [Client-ready tasks](https://github.com/mindcleanser/mindcleanser/blob/master/src/app/events/clientReady/logs.js): `src/app/events/clientReady/logs.js`
- [Bot link settings](https://github.com/mindcleanser/mindcleanser/blob/master/config.json): `config.json`

### Other components

- **Discord user**
- **Discord platform**
- **Discord Bot List**

## Connections

- Discord client → Discord platform: creates client (evidence: `src/app.ts`)
- Discord user → NAMI resources: invokes (unverified)
- Discord user → Trevor Project: invokes (unverified)
- Discord user → Trans Lifeline: invokes (unverified)
- Discord user → Help overview: invokes (unverified)
- Discord user → GitHub link: invokes (unverified)
- Discord user → Bot invite: invokes (unverified)
- Discord user → Support server: invokes (unverified)
- Discord user → Voting links: invokes (unverified)
- Discord user → Contributor list: invokes (unverified)
- Discord user → Ping command: invokes (unverified)
- NAMI resources → Discord platform: replies (evidence: `src/app/commands/nami.js`)
- Trevor Project → Discord platform: replies (evidence: `src/app/commands/trevorproj.js`)
- Trans Lifeline → Discord platform: replies (evidence: `src/app/commands/transll.js`)
- Help overview → Discord platform: replies (evidence: `src/app/commands/help.js`)
- GitHub link → Discord platform: replies (evidence: `src/app/commands/github.js`)
- Bot invite → Discord platform: replies (evidence: `src/app/commands/invite.js`)
- Support server → Discord platform: replies (evidence: `src/app/commands/support-server.js`)
- Voting links → Discord platform: replies (evidence: `src/app/commands/vote.js`)
- Contributor list → Discord platform: replies (evidence: `src/app/commands/contrib.js`)
- Contributor list → Contributor data: reads (evidence: `src/app/commands/contrib.js`)
- NAMI resources → Bot link settings: reads links (evidence: `src/app/commands/nami.js`)
- Trevor Project → Bot link settings: reads links (evidence: `src/app/commands/trevorproj.js`)
- Trans Lifeline → Bot link settings: reads links (evidence: `src/app/commands/transll.js`)
- Help overview → Bot link settings: reads links (evidence: `src/app/commands/help.js`)
- GitHub link → Bot link settings: reads links (evidence: `src/app/commands/github.js`)
- Bot invite → Bot link settings: reads links (evidence: `src/app/commands/invite.js`)
- Support server → Bot link settings: reads links (evidence: `src/app/commands/support-server.js`)
- Voting links → Bot link settings: reads links (evidence: `src/app/commands/vote.js`)
- Client-ready tasks → Discord platform: updates activity (evidence: `src/app/events/clientReady/logs.js`)
- Client-ready tasks → Discord Bot List: posts bot data (evidence: `src/app/events/clientReady/logs.js`)
