def bing(phenny, input):
 query = input.group(2)
 if query.startswith(':'):
  (lang, query) = query.split(' ', 1)
  lang = lang[1:]
 else:
  lang = 'en-GB'
 if (not query):
  return phenny.reply('.bing what?')
 query = query.encode('utf-8')
 uri = bing_search(query, lang)
 if uri:
  phenny.reply(uri)
  if (not hasattr(phenny.bot, 'last_seen_uri')):
   phenny.bot.last_seen_uri = {}
  phenny.bot.last_seen_uri[input.sender] = uri
 else:
  phenny.reply(("No results found for '%s'." % query))

def bing ( phenny , input ) : query = input . group ( 2 ) if query . startswith ( ':' ) : ( lang , query ) = query . split ( ' ' , 1 ) lang = lang [ 1 : ] else : lang = 'en-GB' if ( not query ) : return phenny . reply ( '.bing what?' ) query = query . encode ( 'utf-8' ) uri = bing_search ( query , lang ) if uri : phenny . reply ( uri ) if ( not hasattr ( phenny . bot , 'last_seen_uri' ) ) : phenny . bot . last_seen_uri = { } phenny . bot . last_seen_uri [ input . sender ] = uri else : phenny . reply ( ( "No results found for '%s'." % query ) )
queries bing for the specified input .