diff options
author | Sean B. Palmer <sbp@aldebaran.local> | 2012-07-21 13:04:31 +0100 |
---|---|---|
committer | Sean B. Palmer <sbp@aldebaran.local> | 2012-07-21 13:04:31 +0100 |
commit | 9505eae02ec38624c0e2a58247f59b65f87ddb3d (patch) | |
tree | a392daa064c08a66c5d18066f8d03092794acb34 /modules/translate.py | |
parent | bac52dfb11ff9709eac08e1dc7231dc8055b8f63 (diff) | |
download | bot-9505eae02ec38624c0e2a58247f59b65f87ddb3d.tar.gz bot-9505eae02ec38624c0e2a58247f59b65f87ddb3d.tar.bz2 bot-9505eae02ec38624c0e2a58247f59b65f87ddb3d.zip |
Twitter module, gc augmentation, and various small fixes
Diffstat (limited to 'modules/translate.py')
-rwxr-xr-x | modules/translate.py | 5 |
1 files changed, 4 insertions, 1 deletions
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() |