@@ -7,8 +7,3 @@
# Deploy
`docker run -p6070:6070 --name rollbot3-instance -d rollbot3`
-
-# Or, run locally
- `cd src/`
- `ROLLBOT_CFG_DIR=../config python3 app.py`
@@ -1,6 +1,4 @@
old:
-roll
-session
seychelles
inspire
pokemon
@@ -4,6 +4,7 @@ database = "/tmp/rollbot.sqlite"
simple = [ "info", "isadmin", "debug", "echo", "thanks", "guess", "meme", "unmeme", "greet", "console" ]
teamspeak = [ "teamspeak" ]
session = [ "session" ]
+roll = [ "roll" ]
[teamspeak]
host = "kirkleon.ddns.net"
@@ -2,4 +2,5 @@ toml
sqlalchemy
Flask
gunicorn
-requests
+requests
+dice
@@ -0,0 +1,18 @@
+import dice
+
+from command_system import RollbotResponse, as_plugin
+@as_plugin
+def roll(db, message):
+ argstr = message.raw_args
+ try:
+ rolls = []
+ for roll_exp in argstr.split(","):
+ roll = dice.roll(roll_exp)
+ if not isinstance(roll, int):
+ roll = int(roll)
+ rolls.append(str(roll))
+ return RollbotResponse(message, txt="Rolled {}, got: {}".format(argstr, ", ".join(rolls)))
+ except Exception as _:
+ return RollbotResponse(message, txt="Sorry - dice expression appears malformed. Add more ()'s")