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)