diff options
| author | 2018-10-03 13:22:37 +0100 | |
|---|---|---|
| committer | 2018-10-03 13:22:37 +0100 | |
| commit | 69d58eede2e9bf83aa1ed1d8fcf956efde494726 (patch) | |
| tree | 11aa30f2a357f3be23ad97315dae3df051455cbe /modules/dice.py | |
| parent | Add 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.py | 9 |
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)) |
