From f3cf50b9ce0b157cd9a1ebcccc308f7dc5f14be0 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 18 Apr 2013 18:33:38 -0300 Subject: [PATCH] Adjust messages again. --- commands/urbandictionary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/urbandictionary.py b/commands/urbandictionary.py index beb3a40..ebed527 100644 --- a/commands/urbandictionary.py +++ b/commands/urbandictionary.py @@ -28,7 +28,9 @@ class UrbanDictionary(Command): if res['result_type'] == 'exact': definition = re.sub(r"\s+", " ", res['list'][0]['definition']) example = re.sub(r"\s+", " ", res['list'][0]['example']) - msg = '{0}; example: {1}'.format(definition, example) + if definition and definition[-1] not in (".", "!", "?"): + definition += "." + msg = '{0} \x02Example\x0F: {1}'.format(definition, example) self.reply(data, msg) elif res['result_type'] == 'fulltext': L = [i['word'] for i in res['list']]