Skip to content

Mommy Bot

Mommy Bot (hereinafter the “Application”) is a multi-platform bot application that provides encouraging and supportive messages across Discord, Slack, and Bluesky platforms. The bot delivers personalized “mommy” messages to users, creating a comforting and nurturing interaction experience.

1. User Documentation

Discord Usage

  • Install the app
  • Use the /mommy slash command
  • Optionally provide a name parameter: /mommy name:YourName
  • The bot will respond with an encouraging message personalized to your name

Slack Usage

  • Install the app
  • Use the /mommy command in any channel where the bot is installed
  • Optionally provide a name: /mommy YourName
  • The bot will respond with an encouraging message

Bluesky Integration

  • The bot automatically posts daily encouraging messages at 9:00 AM
  • Follow @mommy.naomi.party on Bluesky to see these posts

Visit the bot’s homepage to install:

  • Discord: Add to your server via the Discord OAuth link
  • Slack: Install via the Slack App Directory integration
  • Bluesky: Follow the automated account for daily posts

2. Technical Documentation

Architecture Overview

The Application is built using TypeScript and Node.js with the following key components:

Core Platforms

  • Discord: Uses discord.js library for slash command integration
  • Slack: Uses @slack/bolt framework for command handling
  • Bluesky: Uses @atproto/api for automated posting

Main Components

Application Entry Point (src/index.ts)

  • Initializes connections to all three platforms
  • Sets up command handlers for Discord and Slack
  • Configures scheduled posting for Bluesky (daily at 9:00 AM)
  • Manages bot lifecycle and error handling

Web Server (src/server/serve.ts)

  • Fastify-based HTTP server running on port 8009
  • Serves a landing page with installation links
  • Provides health monitoring endpoint
  • Displays branding and social media links

Message Generation (src/utils/getMommy.ts)

  • Fetches encouraging messages from external API
  • Implements profanity filtering using no-profanity library
  • Supports personalized name insertion
  • Defaults to “dear” for filtered or empty names

Logging (src/utils/logger.ts)

  • Uses @nhcarrigan/logger for structured logging
  • Configured with application name “Mommy”
  • Supports remote log token for centralized logging

Deployment

  • Built using TypeScript compiler (npm run build)
  • Production start script uses 1Password for environment management
  • Runs as a persistent Node.js application
  • Requires network access to Discord, Slack, and Bluesky APIs

Dependencies

Key production dependencies:

  • @atproto/api: Bluesky/AT Protocol client
  • @slack/bolt: Slack app framework
  • discord.js: Discord API wrapper
  • fastify: Web server framework
  • node-schedule: Cron-like job scheduler
  • no-profanity: Content filtering

License

The Application is licensed under “Naomi’s Public License” as specified in the source code headers.

All code is copyright © nhcarrigan (Naomi Carrigan).

Third-Party Services

The Application integrates with:

  • Discord API (subject to Discord’s Terms of Service)
  • Slack API (subject to Slack’s API Terms)
  • Bluesky/AT Protocol (subject to Bluesky’s Terms)
  • External message API (mommy.nhcarrigan.com)

Data Handling

  • User names are processed for profanity filtering
  • No persistent user data storage
  • Interaction data follows platform-specific retention policies
  • Logs may contain interaction metadata

4. Contributing Documentation

Environment Variables

Required environment variables:

  • DISCORD_TOKEN: Discord bot token
  • SLACK_CLIENT_ID: Slack app client ID
  • SLACK_CLIENT_SECRET: Slack app client secret
  • SLACK_SIGNING_SECRET: Slack app signing secret
  • SLACK_STATE_SECRET: Slack app state secret
  • BSKY_PASSWORD: Bluesky account password
  • LOG_TOKEN: Remote logging token (optional)

Development Setup

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Configure environment variables
  4. Run in development mode: npm run dev

Code Standards

  • TypeScript with strict type checking
  • ESLint configuration: @nhcarrigan/eslint-config
  • Code must pass linting: npm run lint
  • Follow existing code style and documentation patterns

File Structure

src/
├── index.ts # Main application entry point
├── server/
│ └── serve.ts # Web server implementation
└── utils/
├── getMommy.ts # Core message functionality
└── logger.ts # Logging configuration

Testing

  • Currently no automated tests (test script returns success)
  • Manual testing required for platform integrations
  • Verify commands work on all supported platforms

Deployment Process

  1. Build production assets: npm run build
  2. Ensure environment variables are configured
  3. Start application: npm start
  4. Monitor logs for successful platform connections

Platform-Specific Considerations

  • Discord: Requires bot permissions and slash command registration
  • Slack: Needs app approval and workspace installation
  • Bluesky: Requires valid account credentials and posting permissions

Issue Reporting

Report bugs and feature requests through the project’s issue tracker, including:

  • Platform affected (Discord/Slack/Bluesky)
  • Steps to reproduce
  • Expected vs. actual behavior
  • Environment details