self.elog.warning('feed error in .urbandictionary: %s' % e)
return
- if res['result_type'] == 'no_results' or res['result_type'] == 'fulltext':
+ if 'list' not in res or len(res['list']) < 1:
self.errormsg(channel, 'no results found')
- elif res['result_type'] == 'exact':
+ else:
if def_id:
try:
def_id = int(def_id)
self.errormsg(channel, 'invalid definition number')
except IndexError:
self.errormsg(channel, 'definition id out of range: only %d definitions available' % len(res['list']))
- else:
+ else:
for num, entry in enumerate(res['list'], 1):
if num == 4:
self.notice(sender, u'To view a single definition with a related example, type: @b.u %s /def_number@b. For more definitions, visit: %s' % (expr, res['list'][0]['permalink']))
res = res,
definition = definition if len(definition) < 200 else definition[:200] + '...',
entry = entry))
- else:
- self.msg(channel, 'An exception occurred and has been reported to the developers. If this error persists please do not use the faulty command until it has been fixed.')
- self.elog.warning('unrecognized result type: %s' % res['result_type'])
-
+
def command_imdb(self, manager, opts, arg, channel, sender, userinfo):
try:
reply = self.imdb.get(arg)