aboutsummaryrefslogtreecommitdiff
path: root/modules/dice.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-03 13:22:37 +0100
committerGravatar jesopo2018-10-03 13:22:37 +0100
commit69d58eede2e9bf83aa1ed1d8fcf956efde494726 (patch)
tree11aa30f2a357f3be23ad97315dae3df051455cbe /modules/dice.py
parentAdd a way to not add a user automatically in IRCServer.get_user (diff)
signature
Move src/Utils.py in to src/utils/, splitting functionality out in to modules of
related functionality
Diffstat (limited to 'modules/dice.py')
-rw-r--r--modules/dice.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/dice.py b/modules/dice.py
index ee93f570..26adca3e 100644
--- a/modules/dice.py
+++ b/modules/dice.py
@@ -1,10 +1,10 @@
import random
-from src import ModuleManager, Utils
+from src import ModuleManager, utils
ERROR_FORMAT = "Incorrect format! Format must be [number]d[number], e.g. 1d20"
class Module(ModuleManager.BaseModule):
- @Utils.hook("received.command.roll", min_args=1)
+ @utils.hook("received.command.roll", min_args=1)
def roll_dice(self, event):
"""
:help: Roll some dice, DND style!
@@ -35,6 +35,5 @@ class Module(ModuleManager.BaseModule):
total = sum(results)
results = ', '.join(map(str, results))
- event["stdout"].write("Rolled " + Utils.bold(str_roll) + " for a total "
- + "of " + Utils.bold(str(total))
- + ": " + results)
+ event["stdout"].write("Rolled %s for a total of %d: %s" % (
+ str_roll, str(total), results))