Table of Contents
This is the Discord Bot for my personal Discord Server
Dragon's Den
- 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.
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:
Add docs/images/reaction_roles_example.svg to show a usage screenshot; a lightweight placeholder SVG is included in the repository.
check out to learn to get a copy of the project
Requirements
-
Discord
Discord.js v14.5.1 -
Typescript
Typescript -
node
Node -
Code Editor[Optional Choices] NOTE: i do not know how to setup the project with Atom so everything is based on VS Code
VS Code
Atom
- Create a Discord Developer Application Discord Developer Application
- Clone the repo
git clone https://github.com/skullgaming31/dragonbot.git
- Install NPM packages
npm install
- Fill out the .env with all nessasary Information, check .env.example for whats needed
- build:
npm run buildClone and install dependencies:
git clone https://github.com/SkullGaming31/DragonBot.git
npm ciRun the bot in development mode (hot reload via ts-node):
npm run devBuild for production output (compiled JS in dist/):
npm run build
npm startThe 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:
Enviroment—dev|prod|debugDEV_DISCORD_BOT_TOKEN— token for dev bot loginDISCORD_BOT_TOKEN— token for production bot loginDEV_DISCORD_GUILD_ID— guild id used when registering commands in dev
Run the test suite locally with Vitest:
npm testNotes:
- Many tests use
mongodb-memory-server. To exercise MongoDB transactions the tests start a replica set (MongoMemoryReplSet). Keep replica-set tests short (usecount: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-bullseyecontainer solibcrypto.so.1.1is available. See.github/workflows/ci.yml.
- Prefer
unknownoverany. Use runtime narrowing (seesrc/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 aCommandType(src/Typings/Command.ts). Therunfunction receives{ client, interaction, args }whereinteractionisExtendedInteraction. - Events live in
src/Events/*and implement theEventcontract (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-datarun 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.
- 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).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. checkout LICENSE.md
Corey - @skullgaming31 - skullgamingg31@gmail.com
Project Link: Dragon's Den in Typescript