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)))
def __init__(self, server): self.gsearch = GSearch() xmap(server, 'CMSG', self.find)