Skip to content
/ Arcanum Public

🎲 An open-source Discord bot for tabletop RPGs featuring dice rolling, D&D 5e data integration, loot tracking, and homebrew content support.

License

Notifications You must be signed in to change notification settings

zuedev/Arcanum

Repository files navigation

Arcanum Discord Bot

A Discord bot for tabletop gaming enthusiasts, featuring dice rolling and item tracking functionality.

Features

🎲 Dice Rolling

  • Roll standard dice: /roll d4, /roll d6, /roll d8, /roll d10, /roll d12, /roll d20, /roll d100
  • Roll custom dice: /roll dx sides:20 quantity:3
  • Roll multiple dice: /roll d20 quantity:5
  • Supports up to 100 dice per roll with a maximum of 100 sides per die
  • Optimized for large rolls with chunked processing to avoid timeouts

πŸ“‹ Item Tracking

  • Add items: /tracker add name:sword quantity:2
  • Remove items: /tracker remove name:sword quantity:1
  • List all items: /tracker list
  • Search for items: /tracker search name:sw (supports fuzzy matching)
  • Rename items: /tracker rename old_name:sword new_name:blade (automatically merges if target name exists)
  • Clear tracker: /tracker clear (requires user to have the MANAGE_CHANNELS permission)
  • View audit log: /tracker audit limit:50 (view history of all tracker changes)
  • Per-channel tracking with automatic cleanup of zero-quantity items
  • Complete audit trail of all changes with timestamps and user information

🏦 Currency Bank

D&D Currency System

  • Deposit currency: /bank dnd deposit currency:gold amount:50 (supports platinum, gold, silver, electrum, copper)
  • Withdraw currency: /bank dnd withdraw currency:silver amount:10 (with balance validation)
  • Check balance: /bank dnd balance (shows all currencies with gold value conversion)
  • Convert currency: /bank dnd convert from:gold to:silver amount:10 (with configurable fees)
  • Set conversion fees: /bank dnd setfee rate:0.05 (5% fee, requires MANAGE_CHANNELS)
  • View fee settings: /bank dnd fees (current rates and examples)
  • Clear bank: /bank dnd clear (requires MANAGE_CHANNELS permission)
  • View audit log: /bank dnd audit limit:30 (complete transaction history)

Decimal Currency System

  • Deposit currency: /bank decimal deposit amount:50.25 (supports decimal amounts)
  • Withdraw currency: /bank decimal withdraw amount:25.50 (with balance validation)
  • Check balance: /bank decimal balance (shows current decimal balance)
  • Clear bank: /bank decimal clear (requires MANAGE_CHANNELS permission)
  • View audit log: /bank decimal audit limit:30 (complete transaction history)

Features

  • Per-channel currency management with automatic cleanup
  • Multiple currency systems (D&D standard and decimal)
  • Configurable conversion fees for D&D system (default 10%, 0-100% range)
  • Built-in currency validation and abbreviation display
  • Complete audit trail of all transactions and fee changes

πŸ“ Utility

  • Ping: /ping - Check if the bot is responsive

Installation

Add to Your Server

Click here to add Arcanum to your Discord server

Self-Hosting

Prerequisites

  • Node.js 18 or higher
  • MongoDB database
  • Discord bot token

Setup

  1. Clone the repository:

    git clone https://github.com/zuedev/Arcanum.git
    cd Arcanum
  2. Install dependencies:

    npm install
  3. Create a .env file with your configuration:

    DISCORD_BOT_TOKEN=your_bot_token_here
    MONGODB_URI=mongodb+srv://user:[email protected]/arcanum
  4. Start the bot:

    npm run dev  # Development mode with .env file
    npm start    # Production mode

Testing

Run the test suite:

npm test

Usage Examples

Dice Rolling

/roll d20                    # Roll a single d20
/roll d6 quantity:4          # Roll 4 d6 dice
/roll dx sides:100 quantity:2 # Roll 2 custom 100-sided dice

Item Tracking

/tracker add name:"Health Potion" quantity:3
/tracker remove name:"Health Potion" quantity:1
/tracker list
/tracker search name:potion
/tracker rename old_name:"Health Potion" new_name:"Healing Elixir"
/tracker clear  # Requires MANAGE_CHANNELS permission
/tracker audit limit:20  # View recent 20 changes (default: 20, max: 100)

Currency Bank

D&D Currency System

/bank dnd deposit currency:gold amount:100
/bank dnd withdraw currency:silver amount:25
/bank dnd balance  # View all currency balances with gold conversion
/bank dnd convert from:gold to:silver amount:10  # Convert with fees
/bank dnd setfee rate:0.05  # Set 5% conversion fee (admin only)
/bank dnd fees     # View current fee settings and examples
/bank dnd clear    # Requires MANAGE_CHANNELS permission
/bank dnd audit limit:15  # View recent 15 transactions

Decimal Currency System

/bank decimal deposit amount:150.75
/bank decimal withdraw amount:25.50
/bank decimal balance  # View current decimal balance
/bank decimal clear    # Requires MANAGE_CHANNELS permission
/bank decimal audit limit:15  # View recent 15 transactions

Technical Details

  • Language: JavaScript (ES Modules)
  • Runtime: Node.js
  • Database: MongoDB
  • Discord Library: discord.js v14
  • Architecture: Modular command system with centralized bot logic

Permissions Required

The bot only requires the ability to register slash commands and send messages.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is open source and dedicated to the public domain. Feel free to use, modify, and distribute as needed.

Support

For issues or questions, please open an issue on GitHub.