示例#1
0
class QuickSearch(object):
    def __init__(self, server):
        self.gsearch = GSearch()
        xmap(server, 'CMSG', self.find)
    
    @command('@find data')
    def find(self, server, nick, user, host, target, msg, data):
        result = self.gsearch.quick_search(v='0.1', q=data, safe='high')
        send_msg(server, target, str(choice(result)))
示例#2
0
 def __init__(self, server):
     self.gsearch = GSearch()
     xmap(server, 'CMSG', self.find)