dice command parser/roller discord bot
Project description
Operator Precedence High Roller Package
This is a package for a discord bot. I call it High Roller as a play on its original use for TTRPG rolling, as well as a joking reference to gambling. Also recently I added a !gamble command to make the joke more literal.
How to run - Enter the main directory in terminal. python -m operator_precedence_high_roller.high_roller
Commands -
! is the general character to put before a discord message to be read by the bot.
Command => '!' [EXPR]
Command => '!gamble'
Command => [BET]
Command => '!' [RECALL]
EXPR => [EXPR] '+' [EXPR]
EXPR => [EXPR] '-' [EXPR]
EXPR => [EXPR] '*' [EXPR]
EXPR => [EXPR] '/' [EXPR]
EXPR => '(' [EXPR] ')'
EXPR => [NUM]
EXPR => [ROLL]
ROLL => 'd' [NUM]
ROLL => 'e' [NUM]
ROLL => [NUM] 'd' [NUM]
ROLL => [NUM] 'e' [NUM]
NUM => [0..9]+
BET => 'odds'
BET => 'evens'
RECALL => 'h'
RECALL => 'h' '(' [NUM] ',' [ROLL] ')'
Version history -
1.1.2 - everything except RECALL commands works
1.1.3 - now everything works like it should
1.1.4 - small bug-fix
1.2.0 - big update, all unit tests done, general functional changes
1.2.1 - [
-
XdYkhZ syntax added
-
roll X dice, each of which has Y sides, and keep the highest Z of the results
-
X and Z must not be equal
-
Z must be greater than 0
-
Z can be left blank in the command, in which case it will be set to 1
-
disallow rolls with 0 dice
-
disallow rolls of dice with 0 sides
-
dice roll functions return None instead of (0,0) in the case of errors
-
high_roller.py had to be moved to the outermost directory
-
i'm not at all sure why, but before making the change, calls made from high_roller.py to functions from other files seemingly referenced old versions of them. ]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file operator_precedence_high_roller-1.2.1.tar.gz.
File metadata
- Download URL: operator_precedence_high_roller-1.2.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cf15c5c974273fc483b1264f9937536e2f80532d09118ee91977995c75a8c08
|
|
| MD5 |
dc3107a063bcc227547399d4f2db8e14
|
|
| BLAKE2b-256 |
29a0e42c7f81acb806ca1cdb0ab66636dde9ff0a80ca07fc4e303c0fae2640ca
|
File details
Details for the file operator_precedence_high_roller-1.2.1-py3-none-any.whl.
File metadata
- Download URL: operator_precedence_high_roller-1.2.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a20867537f75e312a8430ddc48310cda3b82b5d0d0113b5f5b718679b906d55f
|
|
| MD5 |
19bd292871ba5def94776b23ee5c5463
|
|
| BLAKE2b-256 |
a74ddd47b7933c1fde6e7d0ff356ae14f71f2f5229ce78668fc3d115551e6a08
|