Skip to content
SkullGaming31Public

Latest commit

 

History

534 Commits

Folders and files

Repository files navigation

DragonBot

Contributors Forks Stargazers Issues MIT License


Project Logo

DragonBot

DragonBot
· Report Bugs · Request Feature

Table of Contents
  1. Reaction Roles Manager
  2. About The Project
  3. Getting Started
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This is the Discord Bot for my personal Discord Server
Dragon's Den

(back to top)

Built With

Economy dashboard controls

The dashboard can enable or disable economy commands per server and disable individual commands. Turning off the economy also stops automatic message rewards; balances remain unchanged. Re-enabling it in the dashboard enables all individual commands when saved. Servers without economy settings keep the existing enabled behavior. The moderation-only /editpoints command remains available to permitted moderators even when the economy is disabled.

DragonBot and the dashboard backend must connect to the same MongoDB database and use the shared economysettings collection. Economy commands, including /begin, require a server context. When adding an economy command, update both src/Utilities/economyCommands.ts and the dashboard's economy API list.

Reaction Roles Manager (quick note)

  • The bot includes a Reaction Roles Manager (see docs/reactionRoles.md). It exposes two ways to create mappings:
    • /reaction create — attach a mapping to an existing message by ID.
    • /reaction create_message — post a message into the specified channel and create the mapping using that new message's ID (convenience subcommand).

See docs/reactionRoles.md for examples, formats, and troubleshooting tips.

(back to top)

Reaction Roles — Usage examples

Quick copy/paste commands (run as an admin in a server where the bot is installed):

  • Create mapping on an existing message:

    /reaction create channel:#announcements message_id:123456789012345678 emoji:✅ role:@Member

    Expected (ephemeral) reply: "Created mapping with id "

  • Create a message and mapping in a single command:

    /reaction create_message channel:#announcements message_content:"Welcome! React to get Member role" emoji:✅ role:@Member

    Expected (ephemeral) reply: "Created mapping with id "

Screenshot placeholder:

Reaction roles example placeholder

Add docs/images/reaction_roles_example.svg to show a usage screenshot; a lightweight placeholder SVG is included in the repository.

Getting Started

check out to learn to get a copy of the project

Prerequisites

Requirements

Installation

  1. Create a Discord Developer Application Discord Developer Application
  2. Clone the repo
    git clone https://github.com/skullgaming31/dragonbot.git
  3. Install NPM packages
    npm install
  4. Fill out the .env with all nessasary Information, check .env.example for whats needed
  5. build:
npm run build

Developer setup (quick)

Clone and install dependencies:

git clone https://github.com/SkullGaming31/DragonBot.git
npm ci

Run the bot in development mode (fast startup with ts-node transpile-only; typecheck separately):

npm run start:dev

Run npm run typecheck to check TypeScript types.

Build for production output (compiled JS in dist/):

npm run build
npm start

ENVIRONMENT variables

The repo uses an intentionally misspelled ENVIRONMENT variable key: ENVIRONMENT (values: dev | prod | debug). Do not rename it without updating src/Structures/Client.ts and other consumers. Check .env.example for a full list, but key vars include:

  • ENVIRONMENT — dev | prod | debug
  • DEV_DISCORD_BOT_TOKEN — token for dev bot login
  • DISCORD_BOT_TOKEN — token for production bot login
  • DEV_DISCORD_GUILD_ID — guild id used when registering commands in dev

Tests & CI

Use Node.js 24 to match CI, and run the test suite locally with Vitest:

npm test

Notes:

  • Many tests use mongodb-memory-server. To exercise MongoDB transactions the tests start a replica set (MongoMemoryReplSet). Keep replica-set tests short (use count:1) to save time.
  • CI runs tests in node:24-bullseye and pins MONGOMS_VERSION to MongoDB 7.0.26, which has a Debian 11 binary. The container also provides libcrypto.so.1.1. See .github/workflows/ci.yml.
  • Database tests download a MongoDB binary on first use unless a matching binary is already cached. Set MONGOMS_VERSION to override the version when needed.

Coding conventions & tips

  • Prefer unknown over any. Use runtime narrowing (see src/Utilities/functions.ts) and add minimal runtime guards if you accept external data.
  • Use safeInteractionReply (src/Utilities/functions.ts) for replies to interactions to avoid duplicate-reply errors and to provide robust fallbacks.
  • Commands live in src/Commands/<Category>/ and export a CommandType (src/Typings/Command.ts). The run function receives { client, interaction, args } where interaction is ExtendedInteraction.
  • Events live in src/Events/* and implement the Event contract (src/Structures/Event.ts). ExtendedClient.registerModules() auto-loads commands and events.

If you change command registration behaviour or the ENVIRONMENT variable, coordinate with the repository owner — these are sensitive to production/dev command registration.

build the docker image to use for docker desktop

docker build -t dragonbot .

create the volume

docker volume create dragonbot-data

run the bot in docker

docker run -d --name dragonbot-container --mount source=dragonbot-data,target=/app/data dragonbot:latest

--all your javascript files will be in a folder called dist host that on your discord bot host.

(back to top)

(back to top)

Roadmap

  • link detect and delete(if not in correct channel)
  • Ticket System
  • Warning System

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. checkout LICENSE.md

(back to top)

Contact

Corey - @skullgaming31 - skullgamingg31@gmail.com

Project Link: Dragon's Den in Typescript

(back to top)

Acknowledgments

(back to top)

Used by

Contributors

Languages