diff options
| author | 2018-09-21 11:38:55 +0100 | |
|---|---|---|
| committer | 2018-09-21 11:39:09 +0100 | |
| commit | a87196c608a237968918d1c21985926850001598 (patch) | |
| tree | 9327e021f1c1fa6258f5e9a57273bb72706b0ed3 /modules/ducks.py | |
| parent | Don't pass around full server details more than we have to. (diff) | |
| signature | ||
Change Utils.color to take a string to wrap in color
Diffstat (limited to 'modules/ducks.py')
| -rw-r--r-- | modules/ducks.py | 11 |
1 files changed, 7 insertions, 4 deletions
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 |
