From 9505eae02ec38624c0e2a58247f59b65f87ddb3d Mon Sep 17 00:00:00 2001 From: "Sean B. Palmer" Date: Sat, 21 Jul 2012 13:04:31 +0100 Subject: Twitter module, gc augmentation, and various small fixes --- modules/translate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/translate.py') diff --git a/modules/translate.py b/modules/translate.py index 94e5f64..927bcb9 100755 --- a/modules/translate.py +++ b/modules/translate.py @@ -75,7 +75,10 @@ tr.priority = 'low' def tr2(phenny, input): """Translates a phrase, with an optional language hint.""" - command = input.group(2).encode('utf-8') + command = input.group(2) + if not command: + return phenny.reply("Need something to translate!") + command = command.encode('utf-8') def langcode(p): return p.startswith(':') and (2 < len(p) < 10) and p[1:].isalpha() -- cgit v1.2.3-1-g7c22