Rhidium

logo

Font_PNG

semantic-release: angular GitHub Release GitHub License

Discord server

πŸ‘‹ Introduction

Rhidium is built out of love for Discord bot development, and has 1 primary goal: to make your life easier. Whether you're just getting started or a seasoned developer, Rhidium is designed to simplify your workflow and help you create bots you can be proud of.

Rhidium is not a lightweight framework. It is built on top of the discord.js library, and aims to provide most of the core functionality required to bootstrap a powerful, modern Discord bot. Written in TypeScript, it provides the benefits of static type-checking and code completion in modern editors.

With Rhidium, you can focus on what's really important: Creating meaningful features

Excited to begin? Get started or try the demo!

We've compromised a list of some of the core functionality provided by Rhidium:

  • [x] Type-safe, re-usable controllers
  • [x] Dynamic component handlers
  • [x] Synchronized local & API commands, automatic refreshes
  • [x] Fully localized (through i18next), convenience localization for commands
  • [x] Colorful console logging & verbose, organized file logging
  • [x] Wide range of everyday utilities and functionality
  • [x] CRON and interval-based jobs

This TypeScript project uses Prisma TypeORM using the postgresql adapter.

Available adapters: cockroachdb, mongodb, postgresql

Note: When using CockroachDB, the autoincrement() default function is defined only on BigInt fields. Change autoincrement() to sequence() if you want an sequential Int field.

Collapse/Expand

Please note, a Discord Application is required for both installation methods.

The quickest, and easiest, way to host/use this bot template is by deploying it inside of a Docker container. We recommend Docker Desktop.

  1. Download the latest release or git clone [email protected]:rhidium/rhidium.git the repo
  2. Run pnpm setup:linux or pnpm setup:windows (depending on your OS) in the project root folder
  3. Edit the newly created .env and /config/config.json files and provide your configuration
  4. Sync the database: docker compose run --rm client sh -c "npx prisma db push"
  5. Start the application: docker compose up -d client (you can view logs with docker compose logs -f client)
  1. Install the additional pre-requisites:
  2. Download the latest release or git clone [email protected]:rhidium/rhidium.git the repo
  3. Run pnpm setup:linux or pnpm setup:windows in the project root folder
  4. Edit the newly created .env and /config/config.json files and provide your configuration
  5. Sync the database: pnpm db:push
  6. Start the application: pnpm start for production, and pnpm dev for local development

The configuration for this project can be found here, and should be very straight-forward.

{
"client": {
"id": "", // Client id from https://discord.dev/application
"token": "", // Client/bot token from https://discord.dev/application
"development_server_id": "" // Only needed for developers/development environments
},
"permissions": {
"owner_id": "1148597817498140774", // The discord user id of the bot owner
"system_administrator_ids": [], // List of discord user ids for system administrators
"developer_ids": [] // List of discord user ids for developers
}
}

Additionally, feel free to explore the personalization options.

The .env file holds your secrets and other environmental values. Let's explain the different keys here:

NODE_ENV=production # The node environment your bot is running in. Available values: production, development

# ---------------------------------- Database ---------------------------------- #
POSTGRES_HOST=localhost # Change to "database" if using docker (compose)
POSTGRES_PORT=5432 # The port your PostgreSQL server is running on. Default is 5432.
POSTGRES_USER=postgres # The username for your PostgreSQL server. Default is "postgres".
POSTGRES_PASSWORD=CHANGE_ME # The password for your PostgreSQL server.
POSTGRES_DB=rhidium # The name of the database to connect to. Default is "rhidium".

# The database URL for connecting to the (PostgreSQL) database. You generally don't
# need to change this, but you can if you want to use a different database or schema.
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public"

We provide multiple resources to help get you started on your project quickly:

  • Explore the Template / Example - If you're new here, the best way to determine if Rhidium is a fit for you is by exploring this complete example.
  • Check out the API Documentation - Once you're convinced, clone the example/template and check out the API docs to learn more about the inner workings and possibilities.
  • Made with TypeScript and discord.js - comes with PM2, Docker, docker compose configurations

Join our support server if you have any questions, feature requests or other feedback:

banner

  • [ ] Command deployment currently doesn't respect enabled#guilds, meaning they are registered as global commands
  • [ ] Localization for prompts/interactions
  • [ ] Add documentation for COMPONENT_HANDLER_IDENTIFIER
  • [ ] Refactor (now-required) (as unknown) as (Any)(Typed/API)Command
  • [ ] Apply data#setDefaultMemberPermissions to relevant commands
  • [ ] Implement (+ refactor) embeds and placeholders from previous version
  • [ ] Implement (global) reusable command middleware, refactor from previous version
  • [ ] Resolve or otherwise review Typedoc warnings
  • [ ] Dashboard for command usage statistics and database metrics
  • [ ] Refactor Prompts into a standalone, opt-in, NPM package

Join our support server if you have any questions, feature requests or other feedback:

banner

Open-source and ISC licensed, meaning you're in full control.