# servicenowdevprogram/slackerbot architecture

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

- Interactive diagram: https://gitdiagram.com/servicenowdevprogram/slackerbot
- Repository: https://github.com/servicenowdevprogram/slackerbot

## Overview

SlackerBot receives Slack events in ServiceNow, records incoming messages, selects a matching parser, and sends responses back to Slack. The parser collection spans lightweight community and entertainment replies, information lookups, administrative actions, and integrations such as GitHub issue creation; quiz buttons have a separate interaction handler. The README also documents GitHub-to-ServiceNow parser synchronization. Core ServiceNow scripts and tables are described but absent from the supplied tree, so their paths are left unspecified; the visible parser excerpts establish their own external lookups and Slack replies.

Main entry points: [`Parsers/Find a book.js`](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Find%20a%20book.js) (Book lookup), [`Parsers/News Article Parser.js`](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/News%20Article%20Parser.js) (News lookup), [`Parsers/Create a GitHub issue.js`](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Create%20a%20GitHub%20issue.js) (Issue reporter), [`Interaction/Handle an SN quiz.js`](https://github.com/servicenowdevprogram/slackerbot/blob/main/Interaction/Handle%20an%20SN%20quiz.js) (Quiz interaction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Slack ingress"]
  node_event_handler["Event handler"]
  node_payload_table[("Payload records")]
end

subgraph group_runtime["Parser runtime"]
  node_parser_registry[("Parser records")]
  node_parser_dispatch["Parser dispatch"]
end

subgraph group_features["Parser capabilities"]
  node_parsers["Parser scripts"]
  node_quiz_interaction["Quiz interaction"]
  node_book_lookup["Book lookup<br/>[Find a book.js]"]
  node_news_lookup["News lookup"]
  node_search_links["Search links"]
  node_issue_reporter["Issue reporter"]
  node_privacy_info["Privacy response"]
  node_community_replies["Community replies"]
  node_fun_replies["Fun replies"]
  node_product_namer["Product name generator"]
end

subgraph group_integrations["External services"]
  node_slacker_api["Slack API"]
  node_openlibrary["OpenLibrary"]
  node_news_api["News API"]
  node_github["GitHub API"]
  node_github_sync["GitHub sync API"]
end

node_slack_user(("Slack user"))

node_slack_user -->|"sends events"| node_event_handler
node_event_handler -->|"records messages"| node_payload_table
node_payload_table -->|"triggers parsing"| node_parser_dispatch
node_parser_dispatch -->|"matches parser"| node_parser_registry
node_parser_dispatch -->|"runs parser"| node_parsers
node_quiz_interaction -->|"updates and replies"| node_slacker_api
node_book_lookup -->|"queries books"| node_openlibrary
node_book_lookup -->|"sends results"| node_slacker_api
node_news_lookup -->|"queries articles"| node_news_api
node_news_lookup -->|"sends results"| node_slacker_api
node_search_links -->|"sends search link"| node_slacker_api
node_issue_reporter -->|"creates issue"| node_github
node_issue_reporter -->|"sends status"| node_slacker_api
node_privacy_info -->|"sends notice"| node_slacker_api
node_community_replies -->|"sends reply"| node_slacker_api
node_fun_replies -->|"sends reply"| node_slacker_api
node_product_namer -->|"sends name"| node_slacker_api
node_github_sync -->|"reads parsers"| node_github
node_github_sync -->|"syncs records"| node_parser_registry

click node_parsers "https://github.com/servicenowdevprogram/slackerbot/tree/main/Parsers"
click node_quiz_interaction "https://github.com/servicenowdevprogram/slackerbot/blob/main/Interaction/Handle%20an%20SN%20quiz.js"
click node_book_lookup "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Find%20a%20book.js"
click node_news_lookup "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/News%20Article%20Parser.js"
click node_search_links "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Search%20Wikipedia.js"
click node_issue_reporter "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Create%20a%20GitHub%20issue.js"
click node_privacy_info "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/SlackerBot%20Privacy%20Management.js"
click node_community_replies "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Link%20to%20all%20ServiceNow%20Developer%20Meetups.js"
click node_fun_replies "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Tell%20a%20Random%20Joke.js"
click node_product_namer "https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Generate%20a%20ServiceNow%20Product%20name.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_event_handler,node_payload_table,node_slack_user toneBlue
class node_parser_registry,node_parser_dispatch toneAmber
class node_parsers,node_quiz_interaction,node_book_lookup,node_news_lookup,node_search_links,node_issue_reporter,node_privacy_info,node_community_replies,node_fun_replies,node_product_namer toneMint
class node_slacker_api,node_openlibrary,node_news_api,node_github,node_github_sync toneRose
```

## Components

### Slack ingress

- **Event handler**
- **Payload records**

### Parser runtime

- **Parser records**
- **Parser dispatch**

### Parser capabilities

- [Parser scripts](https://github.com/servicenowdevprogram/slackerbot/tree/main/Parsers): `Parsers`
- [Quiz interaction](https://github.com/servicenowdevprogram/slackerbot/blob/main/Interaction/Handle%20an%20SN%20quiz.js): `Interaction/Handle an SN quiz.js`
- [Book lookup](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Find%20a%20book.js): `Parsers/Find a book.js`
- [News lookup](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/News%20Article%20Parser.js): `Parsers/News Article Parser.js`
- [Search links](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Search%20Wikipedia.js): `Parsers/Search Wikipedia.js`
- [Issue reporter](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Create%20a%20GitHub%20issue.js): `Parsers/Create a GitHub issue.js`
- [Privacy response](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/SlackerBot%20Privacy%20Management.js): `Parsers/SlackerBot Privacy Management.js`
- [Community replies](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Link%20to%20all%20ServiceNow%20Developer%20Meetups.js): `Parsers/Link to all ServiceNow Developer Meetups.js`
- [Fun replies](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Tell%20a%20Random%20Joke.js): `Parsers/Tell a Random Joke.js`
- [Product name generator](https://github.com/servicenowdevprogram/slackerbot/blob/main/Parsers/Generate%20a%20ServiceNow%20Product%20name.js): `Parsers/Generate a ServiceNow Product name.js`

### External services

- **Slack API**
- **OpenLibrary**
- **News API**
- **GitHub API**
- **GitHub sync API**

### Other components

- **Slack user**

## Connections

- Slack user → Event handler: sends events
- Event handler → Payload records: records messages
- Payload records → Parser dispatch: triggers parsing
- Parser dispatch → Parser records: matches parser
- Parser dispatch → Parser scripts: runs parser
- Quiz interaction → Slack API: updates and replies
- Book lookup → OpenLibrary: queries books
- Book lookup → Slack API: sends results
- News lookup → News API: queries articles
- News lookup → Slack API: sends results
- Search links → Slack API: sends search link
- Issue reporter → GitHub API: creates issue
- Issue reporter → Slack API: sends status
- Privacy response → Slack API: sends notice
- Community replies → Slack API: sends reply
- Fun replies → Slack API: sends reply
- Product name generator → Slack API: sends name
- GitHub sync API → GitHub API: reads parsers
- GitHub sync API → Parser records: syncs records
