Cordelia Taryne
Cordelia Taryne (hereinafter the βApplicationβ) is an AI-powered multi-purpose assistant Discord bot that leverages Anthropicβs Claude AI to provide various text processing, analysis, and assistance features. The bot features a distinctive vampire personality named Cordelia with haughty and self-inflated characteristics, providing users with intelligent assistance while maintaining a unique character persona.
1. User Documentation
This section is for those interacting with a live instance of the Application.
Getting Started
To use Cordelia Taryne, add her to your Discord account.
Available Commands
Cordelia Taryne offers the following slash commands:
/about
- Description: Learn more about the bot
- Usage: Simply run
/about
to get information about the bot, including version and commit details - Access: Available to all users
/query
- Description: Ask Cordelia a general question
- Parameters:
prompt
(required, max 2000 characters) - The question you would like to ask - Usage:
/query prompt: What is the capital of France?
- Access: Requires active subscription
/alt-text
- Description: Generate descriptive and accessible alt-text for images
- Parameters:
image
(required) - The image file to generate alt-text for - Supported formats: JPG, JPEG, PNG, GIF, WEBP
- Limitations: Maximum 5MB file size, maximum 8000px dimensions
- Usage: Upload an image and run
/alt-text image: [your-image]
- Access: Requires active subscription
/eval
- Description: Have Cordelia evaluate and run code snippets
- Parameters:
code
(required, max 2000 characters) - The code to evaluate - Usage:
/eval code: 2 + 2 * 3
- Access: Requires active subscription
/mood
- Description: Analyze the sentiment and mood of text passages
- Parameters:
text
(required, max 2000 characters) - The text to analyze - Usage:
/mood text: I had an amazing day at the beach!
- Access: Requires active subscription
/proofread
- Description: Have Cordelia proofread text for grammar and style
- Parameters:
text
(required, max 2000 characters) - The text to proofread - Usage:
/proofread text: This are my essay about science.
- Access: Requires active subscription
/summarise
- Description: Generate concise summaries of longer text passages
- Parameters:
text
(required, max 2000 characters) - The text to summarize - Usage:
/summarise text: [long article or document text]
- Access: Requires active subscription
Subscription Model
Most features require an active subscription. The bot uses Discordβs premium subscription system:
- Free users can access the
/about
command - Subscribers gain access to all AI-powered features
- Bot owner (developer) has unlimited access for testing and maintenance
Personality
Cordelia has a distinctive personality:
- Character: A vampire assistant with a haughty and self-inflated demeanour
- Appearance: Blonde hair in twin buns, pink-red cat-like eyes, pale skin, gold dress
- Behavior: Subtly condescending but never directly rude or insulting
- Communication: Professional assistance without role-playing text
Support and Feedback
- Bug Reports: Open a GitHub issue
- Feature Requests: Create a GitHub issue with the enhancement label
- General Support: Visit the chat server
- Contact: Email
[email protected]
2. Technical Documentation
This section is for those interested in running their own instance of the Application.
Architecture Overview
Cordelia Taryne is built with:
- Runtime: Node.js with TypeScript
- Discord Library: discord.js v14
- AI Provider: Anthropic Claude API (Claude Sonnet 4)
- Web Server: Fastify (for status page)
- Package Manager: pnpm
- Build System: TypeScript compiler
System Requirements
- Node.js 22+
- pnpm package manager
- Git for version control
- Environment variable management (1Password recommended)
Environment Variables
Required environment variables:
DISCORD_TOKEN
: Discord bot tokenAI_TOKEN
: Anthropic API keynpm_package_version
: Application version (auto-set by npm/pnpm)
Installation and Setup
-
Clone the repository:
Terminal window git clone https://github.com/nhcarrigan/cordelia-taryne.gitcd cordelia-taryne -
Install dependencies:
Terminal window pnpm install -
Set up environment variables:
- Create a
prod.env
file with required variables - Configure 1Password CLI for secure environment management
- Create a
-
Build the application:
Terminal window pnpm run build -
Deploy slash commands:
Terminal window node prod/commands/[command-name].js -
Start the application:
Terminal window pnpm start
Project Structure
src/βββ index.ts # Main application entry pointβββ commands/ # Slash command definitionsβββ modules/ # Command implementation logicβββ config/β βββ personality.ts # Bot personality configurationβββ server/β βββ serve.ts # Web server for status pageβββ utils/ # Utility functions βββ ai.ts # Anthropic AI client βββ calculateCost.ts # Usage cost calculation βββ isSubscribed.ts # Subscription validation βββ logger.ts # Logging utilities βββ replyToError.ts # Error handling
Development Workflow
- Linting:
pnpm run lint
- Building:
pnpm run build
- Development: Make changes in
src/
, build, and test - Deployment: Use the build artifacts in
prod/
API Integration
The bot integrates with:
- Discord API: For bot functionality and user interactions
- Anthropic API: For AI-powered text processing
- Discord Premium: For subscription management
Monitoring and Logging
- Uses
@nhcarrigan/logger
for structured logging - Tracks API usage and costs for each command
- Monitors subscription events (create/delete)
- Error handling with automatic logging
Security Considerations
- All AI interactions are ephemeral (private responses)
- Subscription validation before AI API calls
- Input validation and sanitization
- Secure environment variable management
- Rate limiting through Discordβs built-in mechanisms
3. Legal Documentation
This section is for expansions to our legal policies specific to the Application.
Data Processing
- User Data: Discord user IDs are logged for usage tracking
- Content Processing: Text and images are sent to Anthropic for processing
- Retention: Logs are retained according to standard practices
- Privacy: All interactions are ephemeral and not stored permanently
Third-Party Services
The Application integrates with:
- Discord: User authentication and interaction handling
- Anthropic: AI text and image processing
- 1Password: Secure environment variable management
Subscription Terms
- Subscriptions are managed through Discordβs premium system
- Features are gated behind active subscription status
- Bot owner maintains unlimited access for maintenance
- Usage is tracked and logged for billing transparency
Intellectual Property
- Bot personality and character design are original creations
- Source code is licensed under Naomiβs Public License
- Avatar and visual assets are proprietary
- AI model responses are generated by Anthropicβs Claude
Usage Limits
- Text input limited to 2000 characters per command
- Image uploads limited to 5MB and 8000px dimensions
- API usage tracked and billed to service operator
- Fair use policies apply to prevent abuse
4. Contributing Documentation
This section is for documentation related to contributing to the Applicationβs codebase.
Getting Started
- Read the Guidelines: Review
CONTRIBUTING.md
andCODE_OF_CONDUCT.md
- Fork the Repository: Create your own fork on GitHub
- Set Up Development Environment: Follow technical documentation setup
- Create Feature Branch: Use descriptive branch names
Development Standards
Code Quality
- TypeScript: Strict typing required
- ESLint: Must pass linting with zero warnings (
pnpm run lint
) - Formatting: Follow established code style
- Comments: JSDoc comments for all public functions
Architecture Patterns
- Command Pattern: Separate command definitions from implementations
- Module Separation: Clear separation between Discord logic and AI logic
- Error Handling: Comprehensive error handling with logging
- Type Safety: Proper TypeScript types throughout
File Structure Conventions
src/βββ commands/[name].ts # Discord command definitionsβββ modules/[name].ts # Command implementation logicβββ utils/[name].ts # Shared utilitiesβββ config/[name].ts # Configuration files
Contribution Process
- Issue Creation: Create detailed GitHub issues for bugs/features
- Discussion: Discuss approach before starting work
- Implementation: Follow coding standards and patterns
- Testing: Test thoroughly in development environment
- Pull Request: Create detailed PR with description and testing notes
- Review: Address feedback from maintainers
- Merge: Maintainers will merge approved changes
Testing Guidelines
- Manual Testing: Test all command paths and error cases
- Integration Testing: Verify Discord and Anthropic integrations
- Subscription Testing: Test both subscribed and unsubscribed flows
- Error Scenarios: Test network failures, API errors, and edge cases
Feature Development
Adding New Commands
- Create command definition in
src/commands/[name].ts
- Implement logic in
src/modules/[name].ts
- Add command to main handler in
src/index.ts
- Test subscription gating and error handling
- Update documentation
Modifying AI Behavior
- Update personality configuration if needed
- Modify system prompts in relevant modules
- Test with various inputs and edge cases
- Consider cost implications of changes
Code Review Standards
- Functionality: Does the code work as intended?
- Style: Does it follow established patterns?
- Security: Are there any security concerns?
- Performance: Are there efficiency improvements?
- Documentation: Are changes properly documented?
Release Process
- Version Bump: Update version in
package.json
- Build: Ensure clean build with
pnpm run build
- Testing: Comprehensive testing of new features
- Documentation: Update relevant documentation
- Deployment: Deploy to production environment
- Monitoring: Monitor for issues post-deployment
Community Guidelines
- Respectful Communication: Follow Code of Conduct
- Constructive Feedback: Provide helpful, actionable feedback
- Collaboration: Work together to improve the project
- Learning: Help others learn and grow
- Recognition: Credit contributors appropriately
For more detailed contributing information, see the CONTRIBUTING.md
file in the repository.