---
title: Chibika
---

Chibika (hereinafter the "Application") is a Discord bot that provides ASCII art on demand. The Application offers curated collections of ASCII art in categories such as anime and cats, along with emoji ASCII art, delivered through Discord's slash command interface with subscription-based access control.

## 1. User Documentation

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

### Getting Started

1. **Add Chibika to Your Discord Server**: Use the [Discord OAuth2 authorisation link](https://discord.com/oauth2/authorize?client_id=1396225647269122098) to add Chibika to your Discord server.

2. **Purchase Server Subscription**: To use Chibika's features, you must purchase a server subscription through Discord's built-in store system.

### Available Commands

#### `/about`
Displays information about Chibika, including:
- What the bot does
- How to get started with server subscriptions
- Support and help resources
- Links to Discord server for assistance

#### `/ascii [category]`
Retrieves random ASCII art from the specified category:
- **anime**: Anime-themed ASCII art
- **cats**: Cat-themed ASCII art

Usage: `/ascii category:anime` or `/ascii category:cats`

#### `/emoji`
Retrieves random emoji-based ASCII art from the emoji collection.

### Features

- **Random Art Selection**: Each command returns a randomly selected piece from the respective collection
- **Subscription-Based Access**: Commands require an active Discord server subscription
- **Interactive Components**: Art is displayed using Discord's modern component system
- **Error Handling**: Graceful error messages for invalid inputs or system issues

### Support

If you encounter issues or need assistance:
- Join the [Discord support server](https://chat.nhcarrigan.com)
- Contact via email: `contact@nhcarrigan.com`

## 2. Technical Documentation

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

### Architecture

Chibika is built using:
- **Discord.js v14.21.0**: Discord API integration
- **Fastify v5.4.0**: Web server for health monitoring
- **TypeScript**: Type-safe development
- **Node.js**: Runtime environment

### Project Structure

```
src/
├── assets/          # ASCII art collections
│   ├── anime.ts     # Anime ASCII art data
│   ├── cats.ts      # Cat ASCII art data
│   └── emoji.ts     # Emoji ASCII art data
├── commands/        # Discord slash commands
│   ├── about.ts     # About command handler
│   ├── ascii.ts     # ASCII art command handler
│   └── emoji.ts     # Emoji command handler
├── config/          # Configuration files
│   └── entitlements.ts # Guild entitlement configuration
├── events/          # Discord event handlers
│   └── interactionCreate.ts # Command interaction handling
├── interfaces/      # TypeScript interfaces
│   ├── ascii.ts     # ASCII art data structure
│   └── command.ts   # Command handler interface
├── modules/         # Utility modules
│   ├── getArtComponents.ts # Discord component generation
│   └── sendUnentitledResponse.ts # Subscription check responses
├── server/          # Web server
│   └── serve.ts     # Health monitoring server
├── utils/           # Utility functions
│   ├── checkEntitlement.ts # Subscription verification
│   ├── errorHandler.ts # Error handling
│   ├── getRandomValue.ts # Random selection utility
│   └── logger.ts    # Logging utility
└── index.ts         # Application entry point
```

### Installation and Setup

1. **Prerequisites**:
   - Node.js (compatible with package manager pnpm@10.13.1)
   - Discord Bot Token
   - Discord Application with appropriate permissions

2. **Installation**:
   ```bash
   pnpm install
   ```

3. **Environment Configuration**:
   Create a `prod.env` file with:
   ```
   DISCORD_TOKEN=your_discord_bot_token_here
   ```

4. **Build**:
   ```bash
   pnpm run build
   ```

5. **Start**:
   ```bash
   pnpm start
   ```

### Development

- **Linting**: `pnpm run lint` (ESLint with @nhcarrigan/eslint-config)
- **Testing**: `pnpm run test` (Vitest)
- **TypeScript**: Configured with @nhcarrigan/typescript-config

### Key Components

#### Entitlement System
- Subscription verification through Discord's entitlement API (`src/utils/checkEntitlement.ts:16`)
- Fallback to hardcoded entitled guilds (`src/config/entitlements.ts`)
- Un-entitled users receive subscription prompts (`src/modules/sendUnentitledResponse.ts`)

#### ASCII Art Management
- Structured data format with `text` and `author` fields (`src/interfaces/ascii.ts:7`)
- Category-based organisation (anime, cats, emoji)
- Random selection utility (`src/utils/getRandomValue.ts`)

#### Web Server
- Health monitoring server on port 5018 (`src/server/serve.ts:65`)
- Static HTML page with bot information and links
- Integration with nhcarrigan.com ecosystem

## 3. Legal Documentation

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

### Licensing
- Source code licensed under Naomi's Public Licence
- Copyright held by Naomi Carrigan (@nhcarrigan)

### Terms and Privacy
- [Global Terms of Service](https://docs.nhcarrigan.com/#/terms)
- [Privacy Policy](https://docs.nhcarrigan.com/#/privacy)

### Security
- Security guidelines and reporting procedures outlined in `SECURITY.md`
- Responsible disclosure encouraged through the #bug-reports forum channel on our Discord community

## 4. Contributing Documentation

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

### Contributing Guidelines
- Comprehensive contributing guidelines: https://docs.nhcarrigan.com/#/contributing
- Additional project-specific guidelines in `CONTRIBUTING.md`

### Code Standards
- **ESLint Configuration**: @nhcarrigan/eslint-config v5.2.0
- **TypeScript**: Strict configuration via @nhcarrigan/typescript-config v4.0.0
- **Testing**: Vitest for unit testing
- **Code Style**: Enforced through automated linting with zero warnings policy

### Development Workflow
1. Fork the repository
2. Create feature branch
3. Make changes following code standards
4. Run tests and linting: `pnpm run test && pnpm run lint`
5. Build successfully: `pnpm run build`
6. Submit pull request

### Issue Reporting
- Bug reports and feature requests via [GitHub Issues](https://github.com/anthropics/claude-code/issues) (external project)
- Security issues through responsible disclosure (see `SECURITY.md`)

### Community
- [Discord Server](https://chat.nhcarrigan.com) for real-time discussion
- Code of Conduct available at repository root

### Architecture Decisions
- Discord.js v14 for modern Discord API features
- TypeScript for type safety and developer experience
- Fastify for lightweight web server functionality
- Component-based Discord interactions for enhanced user experience
- Subscription-based access model through Discord's monetization features
