Skip to content

About

A simple AI assistant Discord bot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Cranberry Discord Bot

An AI powered Discord bot assistant for Helix Labs, built with Discord.js v14 and SapphireJS.

Features

  • AI-powered responses using Ollama backend
  • Slash commands for interaction
  • Message context menus for explanations
  • Prefix-based text commands
  • Interactive mention responses with embeds and buttons

Setup

  1. Clone the repository
  2. Install dependencies: npm install
  3. Create a .env file with your Discord bot token and Ollama URL
  4. Build the project: npm run build
  5. Start the bot: npm start

Configuration

The bot uses a centralized configuration system in src/config.ts. Environment variables from .env are loaded into a typed configuration object for better type safety and organization.

Environment Variables

  • DISCORD_TOKEN: Your Discord bot token (required)
  • OLLAMA_BASE_URL: Ollama API base URL
  • BOT_PREFIX: Command prefix for text commands (default: -)
  • OLLAMA_MODEL: AI model to use (default: gemma3:1b)
  • SYSTEM_PROMPT: System prompt for the AI model (see config.ts for default)

Customizing the AI Behavior

You can customize how the AI responds by modifying the SYSTEM_PROMPT in src/config.ts or by setting the SYSTEM_PROMPT environment variable in your .env file.

Commands

  • /ask <prompt>: Ask the AI a question
  • Right-click a message → "Explain Message": Get AI explanation and context for the selected message
  • -ping: Test bot latency
  • @Cranberry: Get interactive help menu with buttons

Development

Use npm run dev for development with ts-node.

License

MIT

About

A simple AI assistant Discord bot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages