def __init__(self, msg=None): if msg: xmpp.Message.__init__(self, node=str(msg)) else: xmpp.Message.__init__(self) EventBase.__init__(self) if msg: self.orig = msg self.jabber = True #self.id = self.getID() self.bot = None self.botoutput = False self.isresponse = False self.type = self.getType()
def cmnd(self, event, name, cmnd): """ do command on a bot by name. """ name = name.lower() bot = self.byname(name) if not bot: return 0 from gozerbot.eventbase import EventBase j = EventBase(event) j.txt = cmnd q = Queue.Queue() j.queues = [q] j.speed = 3 start_new_thread(plugins.trydispatch, (bot, j)) result = waitforqueue(q) if not result: return res = ["[%s]" % bot.name, ] res += result event.reply(res)
def cmnd(self, event, name, cmnd): """ do command on a bot by name. """ name = name.lower() bot = self.byname(name) if not bot: return 0 from gozerbot.eventbase import EventBase j = EventBase(event) j.txt = cmnd q = Queue.Queue() j.queues = [q] j.speed = 3 start_new_thread(plugins.trydispatch, (bot, j)) result = waitforqueue(q) if not result: return res = [ "[%s]" % bot.name, ] res += result event.reply(res)
def __init__(self, ievent=None): EventBase.__init__(self, ievent)