From a87196c608a237968918d1c21985926850001598 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 21 Sep 2018 11:38:55 +0100 Subject: Change Utils.color to take a string to wrap in color --- modules/ducks.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/ducks.py') diff --git a/modules/ducks.py b/modules/ducks.py index 817e444f..86bb2f0c 100644 --- a/modules/ducks.py +++ b/modules/ducks.py @@ -145,10 +145,13 @@ class Module(object): duck += DUCK_TAIL duck += random.choice(DUCK_HEAD) - duck = str(Utils.color(4) + Utils.bold( - duck + random.choice(DUCK_MESSAGE_RARE)) + Utils.color( - 4)) if 1 == random.randint(1, 20) else duck + random.choice( - DUCK_MESSAGE) + if random.randint(1, 20) == 1: + # rare! + message = random.choice(DUCK_MESSAGE_RARE) + duck = Utils.color(Utils.bold(duck + message), Utils.COLOR_RED) + else: + # not rare! + duck += random.choice(DUCK_MESSAGE) channel.send_message(duck) channel.games["ducks"]["duck_spawned"] = 1 -- cgit v1.3.1-10-gc9f91