askcompu

Untitled

Aug 9th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. def episode(phenny, input):
  2.     """Finds MLP Episodes. Commands can be .ep season 2 episode 1 or .ep episode 27 or .ep next or .ep last"""
  3.     query = input.group(2)
  4.     if not query: return phenny.reply('.ep what?')
  5.  
  6.     uri = urban_dictionary_search(query, phenny)
  7.     if uri:
  8.         if uri.startswith('nope'):
  9.             uris = uri.split('$')
  10.             phenny.say("Sorry " + input.nick + ", I couldn't find the " + uris[1] + " episode."
  11.         else:
  12.             phenny.say("Here's what I got, " + input.nick + ": " + uri)
  13.             if not hasattr(phenny.bot, 'last_seen_uri'):
  14.                 phenny.bot.last_seen_uri = {}
  15.             phenny.bot.last_seen_uri[input.sender] = uri
  16.     else: phenny.say("Sorry " + input.nick + ", I couldn't find any episodes for '%s'." % query)
  17. urban_dictionary.commands = ['ep','episode']
Advertisement
Add Comment
Please, Sign In to add comment