Arctem / arcbot

IRC bot created in my free time, pretty poor code because I never planned it to be this large or have more than a couple random features.
3 stars 5 forks source link

.define fails if no rhyme is found. #36

Closed Arctem closed 7 years ago

Arctem commented 7 years ago

This problem can be tested using 'putrid' as input.


  File "/home/arctem/.local/lib/python3.5/site-packages/circuits/core/manager.py", line 661, in _dispatcher
    value = event_handler(*eargs, **ekwargs)
  File "/home/arctem/ircbot/ircbot/command.py", line 32, in command
    self._function(source, target, args)
  File "/home/arctem/arcbot/words/define.py", line 55, in define
    self.fire(sendmessage(channel, '{}: {}'.format(user.nick, define_command(args))))
  File "/home/arctem/arcbot/words/define.py", line 31, in define_command
    rhyme_word = get_rhyme(word)
  File "/home/arctem/arcbot/words/define.py", line 14, in get_rhyme
    return random.choice(results)['word']
  File "/usr/lib/python3.5/random.py", line 255, in choice
    raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence```