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 personalised “mommy” messages to users, creating a comforting and nurturing interaction experience.
1. User Documentation
Section titled “1. User Documentation”Discord Usage
Section titled “Discord Usage”- Install the app
- Use the
/mommyslash command - Optionally provide a name parameter:
/mommy name:YourName - The bot will respond with an encouraging message personalised to your name
Slack Usage
Section titled “Slack Usage”- Install the app
- Use the
/mommycommand in any channel where the bot is installed - Optionally provide a name:
/mommy YourName - The bot will respond with an encouraging message
Bluesky Integration
Section titled “Bluesky Integration”- The bot automatically posts daily encouraging messages at 9:00 AM
- Follow @mommy.naomi.party on Bluesky to see these posts
Installation Links
Section titled “Installation Links”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
Section titled “2. Technical Documentation”Architecture Overview
Section titled “Architecture Overview”The Application is built using TypeScript and Node.js with the following key components:
Core Platforms
Section titled “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
Section titled “Main Components”Application Entry Point (src/index.ts)
- Initialises 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 personalised 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 centralised logging
Deployment
Section titled “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
Section titled “Dependencies”Key production dependencies:
@atproto/api: Bluesky/AT Protocol client@slack/bolt: Slack app frameworkdiscord.js: Discord API wrapperfastify: Web server frameworknode-schedule: Cron-like job schedulerno-profanity: Content filtering
3. Legal Documentation
Section titled “3. Legal Documentation”License
Section titled “License”The Application is licensed under “Naomi’s Public Licence” as specified in the source code headers.
Copyright
Section titled “Copyright”All code is copyright © SpellWare (Naomi Carrigan).
Third-Party Services
Section titled “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.spellware.dev)
Data Handling
Section titled “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
Section titled “4. Contributing Documentation”Environment Variables
Section titled “Environment Variables”Required environment variables:
DISCORD_TOKEN: Discord bot tokenSLACK_CLIENT_ID: Slack app client IDSLACK_CLIENT_SECRET: Slack app client secretSLACK_SIGNING_SECRET: Slack app signing secretSLACK_STATE_SECRET: Slack app state secretBSKY_PASSWORD: Bluesky account passwordLOG_TOKEN: Remote logging token (optional)
Development Setup
Section titled “Development Setup”- Clone the repository
- Install dependencies:
pnpm install - Configure environment variables
- Run in development mode:
npm run dev
Code Standards
Section titled “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
Section titled “File Structure”src/├── index.ts # Main application entry point├── server/│ └── serve.ts # Web server implementation└── utils/ ├── getMommy.ts # Core message functionality └── logger.ts # Logging configurationTesting
Section titled “Testing”- Currently no automated tests (test script returns success)
- Manual testing required for platform integrations
- Verify commands work on all supported platforms
Deployment Process
Section titled “Deployment Process”- Build production assets:
npm run build - Ensure environment variables are configured
- Start application:
npm start - Monitor logs for successful platform connections
Platform-Specific Considerations
Section titled “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
Section titled “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 behaviour
- Environment details