@commands(u'duck', u'ddg', u'g')
@example(u'.duck privacy or .duck !mcwiki obsidian')
def duck(bot, trigger):
 query = trigger.group(2)
 if (not query):
  return bot.reply(u'.ddg what?')
 result = duck_api(query)
 if result:
  bot.reply(result)
  return
 uri = duck_search(query)
 if uri:
  bot.reply(uri)
  if (u'last_seen_url' in bot.memory):
   bot.memory[u'last_seen_url'][trigger.sender] = uri
 else:
  bot.reply((u"No results found for '%s'." % query))

@ commands ( u'duck' , u'ddg' , u'g' ) @ example ( u'.duck privacy or .duck !mcwiki obsidian' ) def duck ( bot , trigger ) : query = trigger . group ( 2 ) if ( not query ) : return bot . reply ( u'.ddg what?' ) result = duck_api ( query ) if result : bot . reply ( result ) return uri = duck_search ( query ) if uri : bot . reply ( uri ) if ( u'last_seen_url' in bot . memory ) : bot . memory [ u'last_seen_url' ] [ trigger . sender ] = uri else : bot . reply ( ( u"No results found for '%s'." % query ) )
queries duck duck go for the specified input .