From 69d58eede2e9bf83aa1ed1d8fcf956efde494726 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 3 Oct 2018 13:22:37 +0100 Subject: Move src/Utils.py in to src/utils/, splitting functionality out in to modules of related functionality --- modules/dice.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/dice.py') 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)) -- cgit v1.3.1-10-gc9f91