Added error checking for empty parameters

This commit is contained in:
Steve Vaught
2011-04-19 00:50:58 -04:00
parent 6c00d59973
commit 482161e98b
5 changed files with 12 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ def format(word, definitions, number=2):
return result.strip(' .,')
def w(phenny, input):
if not input.group(2):
return phenny.reply("Nothing to define.")
word = input.group(2)
etymology, definitions = wiktionary(word)
if not definitions: