New "limit" config variable, and some module fixes.

This commit is contained in:
Sean B. Palmer
2008-03-31 16:17:32 +01:00
parent fb2cd452e9
commit 286d4a8497
10 changed files with 48 additions and 23 deletions

View File

@@ -68,9 +68,10 @@ def translate(phrase, lang, target='en'):
def tr(phenny, input):
"""Translates a phrase, with an optional language hint."""
input, output, phrase = input.groups()
original_input = input
input, output, phrase = original_input.groups()
phrase = phrase.encode('utf-8')
if (len(phrase) > 350) and (not phenny.admin(input.nick)):
if (len(phrase) > 350) and (not original_input.admin):
return phenny.reply('Phrase must be under 350 characters.')
input = input or guess_language(phrase)