updated README

This commit is contained in:
Marcus Netz
2021-04-28 16:29:40 +02:00
parent c1ac938588
commit beb4ee7ef5

View File

@ -1,4 +1,5 @@
[![CodeQL](https://github.com/TobenderZephyr/dsabot/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/TobenderZephyr/dsabot/actions/workflows/codeql-analysis.yml) [![CodeQL](https://github.com/TobenderZephyr/dsabot/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/TobenderZephyr/dsabot/actions/workflows/codeql-analysis.yml)
# DSA Discord Bot # DSA Discord Bot
This Project is a fork of LucaSchwan/dsa-bot. This Project is a fork of LucaSchwan/dsa-bot.
@ -10,37 +11,44 @@ It can roll dice and even compare results with your characters attributes.
# Commands # Commands
### !help ### !help
Send the user a simple command list with things to do. Send the user a simple command list with things to do.
## Dice Rolling ## Dice Rolling
### !roll *x* W/D *y* ### !roll _x_ W/D _y_
This command can be used to roll dice. To use it one has to put in the number of dice to use as the *x* and the number of sides as the *y* in between those Numbers stands W/D which simply means dice(D) or the german word "Würfel" (W). Theoretically it doesn't matter what Letter is in between but for roleplay gamers this should feel natural. This command can be used to roll dice. To use it one has to put in the number of dice to use as the _x_ and the number of sides as the _y_ in between those Numbers stands W/D which simply means dice(D) or the german word "Würfel" (W). Theoretically it doesn't matter what Letter is in between but for roleplay gamers this should feel natural.
ie `!roll 3w20` ie `!roll 3w20`
### !heads ### !heads
Throw a coin. Heads or Tails? Throw a coin. Heads or Tails?
## Tracking System ## Tracking System
As this Bot should help with tracking your character, simply attach your .tdc file in a private message. As this Bot should help with tracking your character, simply attach your .tdc file in a private message.
### !ep / !ap [Value] ### !ep / !ap [Value]
Probes on your attributes. Probes on your attributes.
Rolls 1 die and compares it with the given value. Rolls another, if returned number is 1 or 20. Rolls 1 die and compares it with the given value. Rolls another, if returned number is 1 or 20.
ie `!ep 11` ie `!ep 11`
### !ep / !ap [Attribute or Abbreviation] ### !ep / !ap [Attribute or Abbreviation]
Does the same as above. You don't need to remember your stats (if you sent a `tdc`-File, that is.) Does the same as above. You don't need to remember your stats (if you sent a `tdc`-File, that is.)
ie. `!ep Mut` or `!ep KK` ie. `!ep Mut` or `!ep KK`
### !skill [skillname] ### !skill [skillname]
Returns the current level of the desired skill. Returns the current level of the desired skill.
### !attack [weaponname] ([-Disadvantages/+Advantages]) ### !attack [weaponname] ([-Disadvantages/+Advantages])
Rolls an attack by using the weapon based skillset. Calculates your combat technique value and takes into account for `MU` or `FF`. Rolls an attack by using the weapon based skillset. Calculates your combat technique value and takes into account for `MU` or `FF`.
`caution`: It does not yet make use of any benefits or disadvantages your character possesses. `caution`: It does not yet make use of any benefits or disadvantages your character possesses.
@ -49,19 +57,24 @@ ie. `!attack Waqqif`
For a list of weapons to chose from, use `!weapons` For a list of weapons to chose from, use `!weapons`
### !talent [skillname] ([-Disadvantages/+Advantages]) ### !talent [skillname] ([-Disadvantages/+Advantages])
Rolls 3 dice and compares the results of each with your current level of character attributes including your bonus on that particular skill. Rolls 3 dice and compares the results of each with your current level of character attributes including your bonus on that particular skill.
`caution`: It does not yet make use of any benefits or disadvantages your character has (at the moment). `caution`: It does not yet make use of any benefits or disadvantages your character has (at the moment).
ie. `!talent klettern -2` ie. `!talent klettern -2`
``` ```
@TobenderZephyr, Du würfelst auf das Talent Klettern. @TobenderZephyr, Du würfelst auf das Talent Klettern.
Deine Werte für MU, GE, KK sind 12, 13, 12. (Bonus: 6) Deine Werte für MU, GE, KK sind 12, 13, 12. (Bonus: 6)
Das waren deine 🎲: 1, 16, 2. Damit hast du 3/3 Proben bestanden. Dein Bonus: 3/6. Das waren deine 🎲: 1, 16, 2. Damit hast du 3/3 Proben bestanden. Dein Bonus: 3/6.
``` ```
### !talents ### !talents
Sends the User a list of talents to use on the `!talent` command. Sends the User a list of talents to use on the `!talent` command.
### !tp [attribute1] [attribute2] [attribute3] ([bonus] [-Disadvantage/+Advantages]) ### !tp [attribute1] [attribute2] [attribute3] ([bonus] [-Disadvantage/+Advantages])
This command also rolls 3 dice and compares their values with entered arguments. This command also rolls 3 dice and compares their values with entered arguments.
This one is better suited for people, who did not provide a `.tdc`-File or if one of the other numerous Advantages and/or Disadvantages need to be taken into account. This one is better suited for people, who did not provide a `.tdc`-File or if one of the other numerous Advantages and/or Disadvantages need to be taken into account.
@ -74,9 +87,35 @@ Roll with a set Bonus of 4:
Roll with a Benefit given by the GM: Roll with a Benefit given by the GM:
`!tp 11 10 11 0 +2` `!tp 11 10 11 0 +2`
### !spells [spell]
This command returns a list of spells known to you. This differs from `!talents` because there would be many more additions to certain
spells through rule books.
If you define a spell by not leaving arguments empty, it will display your current level and checks on your stats.
### !chants [chant]
See `!spells`. This uses karma point talents.
### !cast [spell] ([-Disadvantages/+Advantages])
Rolls 3 dice and compares the results of each with your current level of character attributes including your bonus on that particular spell.
`caution`: It does not yet make use of any benefits or disadvantages your character has (at the moment).
ie. `!cast fulminictus +1`
### !chant [chant] ([-Disadvantages/+Advantages])
See `!cast`. This uses karma point talents.
ie. `!chant Lautlos +1`
# How to use # How to use
To connect the script to a Bot, you need to create a Bot using the Discord Developer Portal. To do this you can follow a guide like [this](https://discordpy.readthedocs.io/en/latest/discord.html). To connect the script to a Bot, you need to create a Bot using the Discord Developer Portal. To do this you can follow a guide like [this](https://discordpy.readthedocs.io/en/latest/discord.html).
## Docker ## Docker
Just pull the docker image and you are good to go. Just pull the docker image and you are good to go.
`docker pull tobenderzephyr/dsabot:latest` `docker pull tobenderzephyr/dsabot:latest`
@ -85,12 +124,20 @@ The container needs at least the following Environment variables:
`BOT_TOKEN`: The token which you retrieve for your bot Discord Developer Portal `BOT_TOKEN`: The token which you retrieve for your bot Discord Developer Portal
`CMDPREFIX`: Instead of using `!` as your prefix, you may want to use your own. `CMDPREFIX`: Instead of using `!` as your prefix, you may want to use your own.
You may run the container with `docker run -rm -v ./data:/usr/src/app/data -e BOT_TOKEN=[token] -e CMDPREFIX=! tobenderzephyr/dsabot:latest` ### Attention
As of version 1.5, more data is stored into separated json files which reside under the data folder.
To not place an empty directory into the container, please first create an empty file 'dsabot.db' and mount that into the container.
You could also update json files (Spells, Chants, and more to come) on your own.
You may run the container with `docker run -rm -v ./data/dsabot.db:/usr/src/app/data/dsabot.db -e BOT_TOKEN=[token] -e CMDPREFIX=! tobenderzephyr/dsabot:latest`
The database is stored under `./data`, so you are good to just mount this as a volume as seen in the example above. The database is stored under `./data`, so you are good to just mount this as a volume as seen in the example above.
### docker-compose ### docker-compose
You may aswell use a simple `docker-compose.yml` and use docker-compose for easy running the app: You may aswell use a simple `docker-compose.yml` and use docker-compose for easy running the app:
``` ```
version: "3" version: "3"
services: services:
@ -102,7 +149,7 @@ services:
BOT_TOKEN: <YOUR TOKEN> BOT_TOKEN: <YOUR TOKEN>
CMDPREFIX: ! CMDPREFIX: !
volumes: volumes:
- ./data:/usr/src/app/data - ./data/dsabot.db:/usr/src/app/data/dsabot.db
``` ```
## manual setup ## manual setup
@ -114,12 +161,10 @@ Then you need to run the following code inside of a terminal while beeing in the
`npm install` `npm install`
Rename `.sample.env` file to `.env` Rename `.sample.env` file to `.env`
Enter the token you received on the Discord Developer Portal into the variable BOT_TOKEN inside `.env`. Enter the token you received on the Discord Developer Portal into the variable BOT_TOKEN inside `.env`.
When you joined your Bot to your desired channel all you need to enter inside the bots directory: When you joined your Bot to your desired channel all you need to enter inside the bots directory:
`npm start` `npm start`
Then your Bot should run and be working in your channel. Then your Bot should run and be working in your channel.