# umeshrege/hangoutsbot architecture

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

- Interactive diagram: https://gitdiagram.com/umeshrege/hangoutsbot
- Repository: https://github.com/umeshrege/hangoutsbot

## Overview

HangoutsBot is a Hangouts chat bot: messages arrive through the bot client, are wrapped as conversation events, and are handled by the message handler and command dispatcher before commands produce chat responses. The documented product also supports configurable autoreplies, conversation forwarding, admin restrictions, rename watching, reminders, and URL summarization. Sampled code confirms client setup, dispatch mechanics, command registration, and some integrations; unsampled handlers and default commands are represented at their exact tree paths, with uncertain links omitted.

Main entry points: [`Core/Handlers.py`](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py) (Message handlers), [`Core/Bot.py`](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Bot.py) (Hangouts bot), [`Core/Commands/ExtraCommands.py`](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/ExtraCommands.py) (Extra commands), [`Core/Commands/Dispatcher.py`](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/Dispatcher.py) (Command dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot Runtime"]
  node_main["Startup<br/>[Main.py]"]
  node_bot["Hangouts bot<br/>[Bot.py]"]
  node_handlers["Message handlers<br/>[Handlers.py]"]
end

subgraph group_commands["Commands"]
  node_dispatcher["Command dispatcher<br/>[Dispatcher.py]"]
  node_default["Default commands<br/>[DefaultCommands.py]"]
  node_extra["Extra commands<br/>[ExtraCommands.py]"]
end

subgraph group_config["Configuration"]
  node_configdict["Config storage<br/>[ConfigDict.py]"]
  node_configfile["Bot settings"]
end

subgraph group_features["Chat Features"]
  node_utilbot["Chat utilities<br/>[UtilBot.py]"]
  node_database[("SQLite state<br/>[UtilDB.py]")]
  node_reminders["Reminder commands<br/>[ExtraCommands.py]"]
  node_autoreplies["Autoreplies<br/>[Handlers.py]"]
  node_forwarding["Conversation forwarding<br/>[Handlers.py]"]
  node_rename["Rename watching<br/>[Handlers.py]"]
end

subgraph group_integrations["Integrations"]
  node_genius["Lyrics lookup<br/>[Genius.py]"]
  node_summarize["URL summarization<br/>[summarize.py]"]
  node_cleverbot["Cleverbot library<br/>[cleverbot.py]"]
end

node_user(("Chat participant"))
node_hangouts{{"Google Hangouts"}}
node_web{{"External web services"}}

node_user -->|"sends message"| node_hangouts
node_hangouts -->|"delivers events"| node_bot
node_main -->|"starts"| node_bot
node_bot -->|"loads settings"| node_configdict
node_configdict -->|"reads JSON"| node_configfile
node_bot -->|"initializes database"| node_database
node_bot -->|"creates handler"| node_handlers
node_handlers -.->|"dispatches commands"| node_dispatcher
node_default -->|"registers commands"| node_dispatcher
node_extra -->|"registers commands"| node_dispatcher
node_extra -->|"uses utilities"| node_utilbot
node_extra -->|"uses lyrics lookup"| node_genius
node_extra -.->|"stores reminders"| node_database
node_handlers -.->|"handles replies"| node_autoreplies
node_handlers -.->|"forwards messages"| node_forwarding
node_handlers -.->|"watches changes"| node_rename
node_genius -->|"fetches lyrics"| node_web
node_summarize -.->|"fetches pages"| node_web

click node_main "https://github.com/umeshrege/hangoutsbot/blob/master/Main.py"
click node_bot "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Bot.py"
click node_handlers "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py"
click node_dispatcher "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/Dispatcher.py"
click node_default "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/DefaultCommands.py"
click node_extra "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/ExtraCommands.py"
click node_configdict "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Util/ConfigDict.py"
click node_utilbot "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Util/UtilBot.py"
click node_database "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Util/UtilDB.py"
click node_reminders "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/ExtraCommands.py"
click node_autoreplies "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py"
click node_forwarding "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py"
click node_rename "https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py"
click node_genius "https://github.com/umeshrege/hangoutsbot/blob/master/Libraries/Genius.py"
click node_summarize "https://github.com/umeshrege/hangoutsbot/blob/master/Libraries/summarize/summarize.py"
click node_cleverbot "https://github.com/umeshrege/hangoutsbot/blob/master/Libraries/cleverbot.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_main,node_bot,node_handlers toneBlue
class node_dispatcher,node_default,node_extra toneAmber
class node_configdict,node_configfile toneMint
class node_utilbot,node_database,node_reminders,node_autoreplies,node_forwarding,node_rename toneRose
class node_genius,node_summarize,node_cleverbot,node_user,node_hangouts,node_web toneIndigo
```

## Components

### Bot Runtime

- [Startup](https://github.com/umeshrege/hangoutsbot/blob/master/Main.py): `Main.py`
- [Hangouts bot](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Bot.py): `Core/Bot.py`
- [Message handlers](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py): `Core/Handlers.py`

### Commands

- [Command dispatcher](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/Dispatcher.py): `Core/Commands/Dispatcher.py`
- [Default commands](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/DefaultCommands.py): `Core/Commands/DefaultCommands.py`
- [Extra commands](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/ExtraCommands.py): `Core/Commands/ExtraCommands.py`

### Configuration

- [Config storage](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Util/ConfigDict.py): `Core/Util/ConfigDict.py`
- **Bot settings**

### Chat Features

- [Chat utilities](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Util/UtilBot.py): `Core/Util/UtilBot.py`
- [SQLite state](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Util/UtilDB.py): `Core/Util/UtilDB.py`
- [Reminder commands](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Commands/ExtraCommands.py): `Core/Commands/ExtraCommands.py`
- [Autoreplies](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py): `Core/Handlers.py`
- [Conversation forwarding](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py): `Core/Handlers.py`
- [Rename watching](https://github.com/umeshrege/hangoutsbot/blob/master/Core/Handlers.py): `Core/Handlers.py`

### Integrations

- [Lyrics lookup](https://github.com/umeshrege/hangoutsbot/blob/master/Libraries/Genius.py): `Libraries/Genius.py`
- [URL summarization](https://github.com/umeshrege/hangoutsbot/blob/master/Libraries/summarize/summarize.py): `Libraries/summarize/summarize.py`
- [Cleverbot library](https://github.com/umeshrege/hangoutsbot/blob/master/Libraries/cleverbot.py): `Libraries/cleverbot.py`

### Other components

- **Chat participant**
- **Google Hangouts**
- **External web services**

## Connections

- Chat participant → Google Hangouts: sends message (evidence: `readme.md`)
- Google Hangouts → Hangouts bot: delivers events (evidence: `Core/Bot.py`)
- Startup → Hangouts bot: starts (evidence: `Main.py`)
- Hangouts bot → Config storage: loads settings (evidence: `Core/Bot.py`)
- Config storage → Bot settings: reads JSON (evidence: `Core/Util/ConfigDict.py`)
- Hangouts bot → SQLite state: initializes database (evidence: `Core/Bot.py`)
- Hangouts bot → Message handlers: creates handler (evidence: `Core/Bot.py`)
- Message handlers → Command dispatcher: dispatches commands
- Default commands → Command dispatcher: registers commands (evidence: `readme.md`)
- Extra commands → Command dispatcher: registers commands (evidence: `Core/Commands/ExtraCommands.py`)
- Extra commands → Chat utilities: uses utilities (evidence: `Core/Commands/ExtraCommands.py`)
- Extra commands → Lyrics lookup: uses lyrics lookup (evidence: `Core/Commands/ExtraCommands.py`)
- Extra commands → SQLite state: stores reminders
- Message handlers → Autoreplies: handles replies
- Message handlers → Conversation forwarding: forwards messages
- Message handlers → Rename watching: watches changes
- Lyrics lookup → External web services: fetches lyrics (evidence: `Libraries/Genius.py`)
- URL summarization → External web services: fetches pages
