Giter Site home page Giter Site logo

mloberg / dwight-discord-bot Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 1.0 2.32 MB

Assistant to the Dungeon Master

Home Page: https://everlastingdungeons.com/sunset/

License: MIT License

TypeScript 98.49% JavaScript 1.18% Dockerfile 0.25% Shell 0.08%
dnd dnd5e dnd-tools discord-bot dungeon-masters

dwight-discord-bot's Introduction

Dwight - Assistant to the Dungeon Master

Dwight is a Discord bot to help dungeon masters with their 5e games.

Overview

  • /35 - Convert 3.5 skills to 5e
  • /elixir - Return a random experimental elixir for Artificers
  • /event - Return a random event
  • /illusions - Manage a Deck of Illusions
  • /item - Return a random magical item
  • /madness - Roll on the madness table and send it to a user
  • /many - The Deck of Many Things
  • /portent - Manage portent dice for a Divination Wizard
  • /spell - Return a random spell
  • /table - Roll on the magic item tables
  • /treasure - Generate random treasure from the treasure tables
  • /tricks - Pull from a Bag of Tricks
  • /wildmagic - Roll on the wild magic table

Running

To run Dwight, you'll first need to create a Discord bot. Follow the instructions over at discordjs.guide to get started.

Once you have a bot created, you can run Dwight via Docker (recommended) or manually.

Docker

The easiest way to run Dwight is via Docker. We host images on GitHub Container Registry.

First you need to register the application commands. You can either do this globally, which can take a couple hours to propegate or for a single guild which is instant.

docker run --rm -e BOT_TOKEN=your-bot-token -e CLIENT_ID=your-client-id ghcr.io/mloberg/dwight-bot install [guild]

Once installed, run the app.

docker run -e BOT_TOKEN=your-bot-token ghcr.io/mloberg/dwight-bot

You can also use Docker Compose. Grab docker-compose.yml, create a .env from .env.dist, and run docker-compose up -d. To register the commands, run docker-compose run --rm bot install.

Manually

To run Dwight without Docker, you'll need NodeJS 16.

First run npm install and npm run build.

Then install the commands.

BOT_TOKEN=your-bot-token CLIENT_ID=your-client-id GUILD_ID=your-guild-id node dist/bin/install.js

Then run the bot.

BOT_TOKEN=your-bot-token npm start

Data

Some commands save data (like portent). By default this is in-memory, but you can either save it to Redis or to disk as a JSON file. To save in redis, pass (or set) DB_URL to redis://user:pass@localhost:6379. To save to disk set file:./path/to/file.json.

docker run -e BOT_TOKEN=your-bot-token -e DB_URL=file:.data/store.json -v $PWD/.data:/app/.data ghcr.io/mloberg/dwight-bot

Development

Copy .env.dist to .env and fill in the values. Rebuild and restart the bot on file changes with npm run dev.

Contributing

Make sure tests (npm test) and lint (npm run lint) pass before submitting a Pull Request.

dwight-discord-bot's People

Contributors

dependabot[bot] avatar mloberg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

palikhov

dwight-discord-bot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.