Skip to content

SkullGaming31/DragonBot

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

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 (hot reload via ts-node):

npm run dev

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

npm run build
npm start

Environment variables

The repo uses an intentionally misspelled environment variable key: Enviroment (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:

  • Enviromentdev | 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

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.
  • On CI, runners may lack OpenSSL 1.1 required by MongoDB binaries. The repo's workflow runs the Tests job in the node:18-bullseye container so libcrypto.so.1.1 is available. See .github/workflows/ci.yml.

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 Enviroment 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)

Contributors 4

  •  
  •  
  •  
  •  

Languages