From 0a96a79077d82de51533d914296b7a51ca19eb3b Mon Sep 17 00:00:00 2001 From: dngfx Date: Sat, 1 Sep 2018 10:52:04 +0100 Subject: Cosmetic enhancement for ducks and dice. --- modules/dice.py | 8 ++++---- modules/ducks.py | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'modules') diff --git a/modules/dice.py b/modules/dice.py index 9862b172..2829cf48 100644 --- a/modules/dice.py +++ b/modules/dice.py @@ -1,5 +1,5 @@ import random - +import Utils class Module(object): def __init__(self, bot, events): @@ -38,6 +38,6 @@ class Module(object): total = sum(results) results = ', '.join(map(str, results)) - event["stdout"].write("Rolled " + str_roll + " for a total " - + "of " + str(total) - + ": [" + results + "]") + event["stdout"].write("Rolled " + Utils.bold(str_roll) + " for a total " + + "of " + Utils.bold(str(total)) + + ": " + results) diff --git a/modules/ducks.py b/modules/ducks.py index fac698f1..e50cc055 100644 --- a/modules/ducks.py +++ b/modules/ducks.py @@ -1,6 +1,6 @@ from operator import itemgetter from threading import Timer -import datetime +import Utils import random @@ -197,9 +197,10 @@ class Module(object): grammar = "" if befriended_ducks == 0 else "s" event["stdout"].write( - target + ", you've befriended " + str( - befriended_ducks + 1) + " duck" + grammar + " in " + event[ - "target"].name) + target + ", you've befriended " + Utils.bold(str( + befriended_ducks + 1)) + " duck" + grammar + " in " + + Utils.bold(event[ + "target"].name)) self.duck_loop_entry(event) @@ -225,9 +226,10 @@ class Module(object): grammar = "" if shot_ducks == 0 else "s" event["stdout"].write( - target + ", you've shot " + str( - shot_ducks + 1) + " duck" + grammar + " in " + event[ - "target"].name) + target + ", you've shot " + + Utils.bold(str(shot_ducks + 1)) + " duck" + + grammar + " in " + + Utils.bold(event["target"].name)) self.duck_loop_entry(event) -- cgit v1.3.1-10-gc9f91