diff options
| author | 2018-11-16 17:39:33 +0000 | |
|---|---|---|
| committer | 2018-11-16 17:39:33 +0000 | |
| commit | b176701e0a7b82564f8106f181db7e3a09cd6460 (patch) | |
| tree | f58a241ae93be0ba1b59658492cb7644134b6cbf /modules | |
| parent | Make IP regex neater in modules/ip_addresses.py (diff) | |
| signature | ||
Fix string formatting of modules/dice.py
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/dice.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/dice.py b/modules/dice.py index 5e8ddd33..db499f3a 100644 --- a/modules/dice.py +++ b/modules/dice.py @@ -30,8 +30,10 @@ class Module(ModuleManager.BaseModule): for i in range(0, num_of_die): results.append(random.randint(1, sides_of_die)) - total = sum(results) + total_n = sum(results) results = ', '.join(map(str, results)) - - event["stdout"].write("Rolled %s for a total of %d: %s" % ( - str_roll, str(total), results)) + total = "" + if len(results) > 1: + total = " (total: %d)" % total_n + event["stdout"].write("Rolled %s and got %s%s" % ( + str_roll, str(total_n), total)) |
