summaryrefslogtreecommitdiffstats
path: root/modules/translate.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/translate.py')
-rwxr-xr-xmodules/translate.py5
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()