---
title: Caelia
---

Caelia (hereinafter the "Application") is a Discord bot that provides gentle reminders when users utilise non-inclusive language in their messages, helping promote more welcoming and inclusive community spaces.

## 1. User Documentation

This section is for those interacting with a live instance of the Application.

### What is Caelia?

Caelia is a Discord bot designed to help create more inclusive communities by gently notifying users when they may have used language that could be considered non-inclusive. The bot uses the Alex.js library to analyse messages and provide helpful suggestions for more inclusive alternatives.

### How to Add Caelia to Your Server

1. Visit the authorisation link: https://discord.com/oauth2/authorise?client_id=1408530011572535346
2. Select your server and grant the necessary permissions
3. Caelia will automatically begin monitoring messages in channels where she has access

### Required Permissions

- **Read Messages**: To analyse message content
- **Send Messages**: To provide feedback and suggestions
- **View Channels**: To monitor designated channels

### Using Caelia

Once added to your server, Caelia works automatically:

- She monitors messages in real-time
- When potentially non-inclusive language is detected, she replies with gentle suggestions
- Code blocks and links are ignored during analysis
- Bot messages and system messages are not analysed

### Slash Commands

- `/about` - Learn about Caelia and her functionality

### Getting Help

If you need assistance or believe Caelia has made an error, you can:
- Join the support Discord server: https://chat.nhcarrigan.com
- Contact support via email: contact@nhcarrigan.com

## 2. Technical Documentation

This section is for those interested in running their own instance of the Application.

### System Requirements

- Node.js (version compatible with TypeScript 5.9.2)
- npm/pnpm package manager
- Discord Bot Token
- Environment variables configuration

### Installation

1. Clone the repository
2. Install dependencies: `pnpm install`
3. Set up environment variables (see Configuration section)
4. Build the project: `pnpm run build`
5. Start the application: `pnpm start`

### Configuration

The application requires the following environment variable:
- `BOT_TOKEN`: Your Discord bot token

### Architecture Overview

The application consists of several key modules:

#### Core Components

- **`src/index.ts`**: Main entry point that initializes the Discord client and event handlers
- **`src/modules/processMessage.ts`**: Handles message analysis using Alex.js for inclusive language checking
- **`src/modules/processInteraction.ts`**: Processes slash command interactions
- **`src/server/serve.ts`**: Fastify web server for health monitoring and bot information
- **`src/config/alex.ts`**: Configuration for the Alex.js language analysis library
- **`src/utils/logger.ts`**: Logging utilities

#### Message Processing Flow

1. Discord message received via `Events.MessageCreate`
2. Message content filtered (removes code blocks and links)
3. Alex.js analyses content for non-inclusive language
4. If issues found, bot responds with suggestions and feedback link
5. Errors are logged and handled gracefully

#### Web Server

A Fastify server runs on port 7055 providing:
- Health check endpoint
- Bot information and invite link
- Links to source code and documentation

### Dependencies

#### Production Dependencies
- `discord.js`: Discord API wrapper
- `alex`: Inclusive language analysis
- `extra-markdown-text`: Markdown processing utilities
- `fastify`: Web server framework
- `@nhcarrigan/logger`: Logging utilities

#### Development Dependencies
- `typescript`: TypeScript compiler
- `eslint`: Code linting
- Various type definitions and configuration packages

### Scripts

- `pnpm build`: Compile TypeScript to JavaScript
- `pnpm lint`: Run ESLint with zero warnings tolerance
- `pnpm start`: Start the production server
- `pnpm test`: Run tests (currently placeholder)

### Deployment

The application is configured for production deployment using:
- 1Password CLI for environment variable management
- Production environment file (`prod.env`)
- Compiled output in `prod/` directory

## 3. Legal Documentation

This section is for expansions to our legal policies specific to the Application.

### License

This software is licensed under Naomi's Public Licence. All code is copyright NHCarrigan and authored by Naomi Carrigan.

### Data Handling

- Caelia analyses message content in real-time but does not store message data
- Only processes text content, ignoring code blocks and URLs
- No personal data is collected or retained
- All processing occurs in memory and is not persisted

### Privacy Considerations

- Message analysis is performed locally within the bot's runtime
- No message content is transmitted to external services beyond Discord's API
- The Alex.js library runs locally and does not send data externally
- Error logging may contain message metadata but not content

### Service Availability

- The bot is provided as-is with no guarantees of uptime
- Support is provided on a best-effort basis
- Service may be interrupted for maintenance or updates

## 4. Contributing Documentation

This section is for documentation related to contributing to the Application's codebase.

### Development Setup

1. Fork the repository
2. Clone your fork locally
3. Install dependencies: `pnpm install`
4. Set up your development environment variables
5. Run linting: `pnpm run lint`
6. Build the project: `pnpm run build`

### Code Style

The project uses:
- ESLint with `@nhcarrigan/eslint-config` for code quality
- TypeScript with strict configuration
- Maximum 0 warnings policy for linting

### Project Structure

```
src/
├── config/          # Configuration files
│   └── alex.ts      # Alex.js configuration
├── modules/         # Core application modules
│   ├── processMessage.ts      # Message analysis logic
│   └── processInteraction.ts  # Slash command handling
├── server/          # Web server components
│   └── serve.ts     # Fastify server setup
├── utils/           # Utility functions
│   └── logger.ts    # Logging utilities
└── index.ts         # Application entry point
```

### Contributing Guidelines

1. Follow the existing code style and patterns
2. Ensure all linting passes with zero warnings
3. Test your changes thoroughly
4. Update documentation as needed
5. Submit pull requests with clear descriptions

### Key Areas for Contribution

- **Language Rules**: Enhancing Alex.js configuration for better accuracy
- **Error Handling**: Improving error recovery and user experience
- **Performance**: Optimising message processing speed
- **Features**: Adding new functionality while maintaining simplicity
- **Documentation**: Improving user and developer documentation

### Reporting Issues

- Post in the #bug-reports forum channel on our Discord community for bug reports
- Join the Discord support server for discussions: https://chat.nhcarrigan.com
- Email support: contact@nhcarrigan.com

### Code Review Process

All contributions require:
- Code review by project maintainers
- Passing lint checks (`pnpm run lint`)
- Successful build (`pnpm run build`)
- Adherence to project conventions and patterns
