Callista
Callista (hereinafter the “Application”) is a Discord bot that allows users to bookmark messages so they can find them later. The Application provides a simple interface for saving message links via DM, with optional note-taking capabilities to help organise and remember why messages were bookmarked.
1. User Documentation
Section titled “1. User Documentation”This section is for those interacting with a live instance of the Application.
1.1. Adding the Bot
Section titled “1.1. Adding the Bot”Callista is available as a Discord user-installable application. You can add Callista to your Discord account by visiting: https://discord.com/oauth2/authorize?client_id=1391494389477412906
1.2. Bookmarking Messages
Section titled “1.2. Bookmarking Messages”To bookmark a message:
- Right-click (or long-press on mobile) any message in a guild or private channel
- Navigate to Apps → Bookmark
- Callista will send you a DM containing the message link
Note: You must have Direct Messages enabled to receive bookmarks. If you receive an error, check your Discord privacy settings.
1.3. Adding Notes to Bookmarks
Section titled “1.3. Adding Notes to Bookmarks”Each bookmark can have an associated note to help you remember context:
- When you receive a bookmark DM, click the Add Note button
- A modal will appear asking “What would you like to note down?”
- Enter your note (1-1000 characters)
- Your note will be appended to the bookmark message
1.4. Editing Notes
Section titled “1.4. Editing Notes”To edit an existing note on a bookmark:
- Click the Edit Note button on the bookmark message
- Update the note text in the modal
- The bookmark message will be updated with your new note
1.5. Deleting Bookmarks
Section titled “1.5. Deleting Bookmarks”To delete a bookmark from your DMs:
- Right-click the bookmark message in your DM with Callista
- Navigate to Apps → Delete
- The bookmark message will be deleted
Note: The Delete command only works in DMs with Callista (bot DM context).
1.6. Additional Features
Section titled “1.6. Additional Features”Each bookmark message includes convenient buttons:
- Add Note/Edit Note: Add or modify notes on your bookmarks
- Join our Discord: Link to the support server (https://chat.spellware.dev)
- Donate: Premium button for supporting the bot developer
1.7. Command Reference
Section titled “1.7. Command Reference”| Command | Type | Context | Description |
|---|---|---|---|
| Bookmark | Message Context Menu | Guilds, Private Channels | Sends you a DM with the message link |
| Delete | Message Context Menu | Bot DMs | Deletes the bookmark message |
2. Technical Documentation
Section titled “2. Technical Documentation”This section is for those interested in running their own instance of the Application.
2.1. Prerequisites
Section titled “2.1. Prerequisites”- Node.js (compatible with version specified in package.json)
- pnpm 10.17.1 or higher (specified in packageManager field)
- A Discord Bot Token
- 1Password CLI (op) for production environment variables (or modify start script)
2.2. Dependencies
Section titled “2.2. Dependencies”Runtime Dependencies:
discord.js(14.22.1): Discord API wrapper@nhcarrigan/logger(1.0.0): Logging utilityfastify(5.6.1): Web server for health monitoring
Development Dependencies:
- TypeScript (5.9.2)
- ESLint with @nhcarrigan configuration
- tsx for development execution
2.3. Installation
Section titled “2.3. Installation”-
Clone the repository:
Terminal window git clone <repository-url>cd callista -
Install dependencies:
Terminal window pnpm install -
Create a production environment file (
prod.env) with the following:BOT_TOKEN=your_discord_bot_token -
Register Discord commands by running:
Terminal window node commandData.jsCopy the output JSON and register it via the Discord Developer Portal or API.
2.4. Building
Section titled “2.4. Building”Compile TypeScript to JavaScript:
pnpm run buildOutput is generated in the prod/ directory.
2.5. Running
Section titled “2.5. Running”Production:
pnpm startThis uses 1Password CLI to inject environment variables. Modify the start script in package.json if using a different secrets management solution.
Development:
tsx src/index.ts2.6. Architecture Overview
Section titled “2.6. Architecture Overview”Project Structure:
src/├── index.ts # Main entry point, Discord client setup├── server/│ └── serve.ts # Fastify web server for health checks (port 6111)├── interactions/│ ├── bookmark.ts # Bookmark command handler│ └── deleteCmd.ts # Delete command handler├── buttons/│ ├── addNote.ts # Add note button definition│ ├── editNote.ts # Edit note button definition│ ├── discord.ts # Discord invite button│ └── donate.ts # Premium donation button├── modals/│ └── note.ts # Note input modal definition└── utils/ └── logger.ts # Logger configurationComponent Interactions:
- Discord Client (
index.ts:22-24): Initialised with no intents (interaction-only bot) - Interaction Handler (
index.ts:27-81): Routes interactions to appropriate handlers - Web Server (
server/serve.ts:54-79): Runs on port 6111 for health monitoring - Message Context Commands: Registered via
commandData.jswith user-install integration
2.7. Bot Configuration
Section titled “2.7. Bot Configuration”The bot requires the following Discord application settings:
Intents: None (the bot uses no gateway intents)
Integration Types:
- User Install (ApplicationIntegrationType.UserInstall)
Interaction Contexts:
- Bookmark: Guilds and Private Channels
- Delete: Bot DMs only
Commands to Register:
[ { "type": 3, "name": "Bookmark", "contexts": [0, 2], "integration_types": [1] }, { "type": 3, "name": "Delete", "contexts": [1], "integration_types": [1] }]2.8. Environment Variables
Section titled “2.8. Environment Variables”| Variable | Required | Description |
|---|---|---|
| BOT_TOKEN | Yes | Discord bot token for authentication |
2.9. Monitoring and Health Checks
Section titled “2.9. Monitoring and Health Checks”The Application exposes a web server on port 6111:
- Endpoint:
GET / - Response: HTML page with bot information
- Purpose: Health monitoring and bot information display
2.10. Logging
Section titled “2.10. Logging”Logging is handled via @nhcarrigan/logger with the following log levels:
debug: Informational messages (bot online, server started)error: Error conditions (server failures, etc.)
Logs are written from utils/logger.ts:1.
2.11. Error Handling
Section titled “2.11. Error Handling”The Application implements error handling for:
- Failed DM delivery (user has DMs disabled) -
interactions/bookmark.ts:43-46 - Missing message context for modals -
index.ts:46-52 - Server startup failures -
server/serve.ts:66-77
2.12. Deployment Considerations
Section titled “2.12. Deployment Considerations”- Port Configuration: The web server runs on port 6111 by default
- Secrets Management: The default start script uses 1Password CLI
- Build Output: Compiled JavaScript is output to
prod/directory - Process Management: Consider using PM2, systemd, or Docker for production
3. Legal Documentation
Section titled “3. Legal Documentation”This section is for expansions to our legal policies specific to the Application.
3.1. License
Section titled “3.1. License”This Application is licensed under Naomi’s Public Licence as indicated in the source file headers.
Copyright held by SpellWare / Naomi Carrigan.
Full licence text available at: https://docs.spellware.dev/#/license
3.2. Privacy
Section titled “3.2. Privacy”Privacy policy document: PRIVACY.md in the repository root.
Data Collection: The Application processes the following user data:
- Discord User IDs (for DM delivery)
- Message URLs (bookmarked messages)
- User-provided notes (stored in Discord messages)
Data Storage: All data is stored within Discord’s infrastructure via message content. The Application does not maintain a separate database.
Data Retention: Data persists as long as users keep their DM messages. Users can delete bookmarks at any time using the Delete command.
3.3. Terms of Service
Section titled “3.3. Terms of Service”Terms of service document: TERMS.md in the repository root.
3.4. Security
Section titled “3.4. Security”Security policy document: SECURITY.md in the repository root.
For security concerns, please follow the reporting procedures outlined in the security policy.
3.5. Code of Conduct
Section titled “3.5. Code of Conduct”Code of conduct document: CODE_OF_CONDUCT.md in the repository root.
4. Contributing Documentation
Section titled “4. Contributing Documentation”This section is for documentation related to contributing to the Application’s codebase.
4.1. Contributing Guidelines
Section titled “4.1. Contributing Guidelines”Contributing guidelines document: CONTRIBUTING.md in the repository root.
Before contributing, please review:
- The Code of Conduct (
CODE_OF_CONDUCT.md) - The Contributing Guidelines (
CONTRIBUTING.md) - The License terms (
LICENSE.md)
4.2. Development Setup
Section titled “4.2. Development Setup”- Fork the repository
- Clone your fork
- Install dependencies:
pnpm install - Create a Discord application and bot at https://discord.com/developers/applications
- Copy your bot token to a
prod.envfile (or use environment variables directly) - Run the development server:
tsx src/index.ts
4.3. Code Standards
Section titled “4.3. Code Standards”The project uses:
- TypeScript (5.9.2) with strict type checking
- ESLint with
@nhcarrigan/eslint-config(5.2.0) - TypeScript Config from
@nhcarrigan/typescript-config(4.0.0)
Run linting with:
pnpm run lintNote: The lint script uses --max-warnings 0, so warnings are treated as errors.
4.4. Code Style Notes
Section titled “4.4. Code Style Notes”- All source files include copyright headers with
@copyright,@license, and@authortags - Some ESLint rules are selectively disabled with comments (e.g.,
index.ts:26) - The project uses ESM (module) syntax (
"type": "module"in package.json)
4.5. Testing
Section titled “4.5. Testing”Currently, the project has a placeholder test script:
pnpm testThis exits with code 0 (no tests configured yet).
4.6. Pull Request Process
Section titled “4.6. Pull Request Process”- Create a feature branch from
main - Make your changes following the code standards
- Run
pnpm run lintto ensure code quality - Run
pnpm run buildto verify the build succeeds - Submit a pull request with a clear description of changes
- Address any review feedback
4.7. Adding New Features
Section titled “4.7. Adding New Features”Adding a new button:
- Create a new file in
src/buttons/exporting aButtonBuilder - Import and add the button to the relevant
ActionRowBuilderinindex.ts - Add handler logic in
handleInteractionif the button requires custom behaviour
Adding a new command:
- Create a handler in
src/interactions/ - Add the command definition to
commandData.js - Run
node commandData.jsand register the output with Discord - Add the command routing logic to
handleInteractioninindex.ts
Adding a new modal:
- Create modal definition in
src/modals/ - Add modal handling logic in the
isModalSubmitsection ofhandleInteraction - Link the modal to a button or command that calls
showModal()
4.8. Repository Information
Section titled “4.8. Repository Information”- Main Branch:
main - Package Manager: pnpm (lockfile version: 10.17.1)
- CI/CD: Configuration available in
.github/directory - Editor Configuration: VSCode settings in
.vscode/
4.9. Contact
Section titled “4.9. Contact”For questions or support:
- Support Server: https://chat.spellware.dev
- Email: [email protected]
- Documentation: https://docs.spellware.dev/
- Source Code: https://github.com/spellware/callista
4.10. Issue Reporting
Section titled “4.10. Issue Reporting”Please report bugs in the #bug-reports forum channel and request features in the #feature-requests forum channel of our Discord community.
Include:
- Clear description of the issue or feature
- Steps to reproduce (for bugs)
- Expected vs actual behaviour
- Environment details (Discord client version, etc.)