Пример #1
0
    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()
Пример #2
0
    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()
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
 def __init__(self, ievent=None):
     EventBase.__init__(self, ievent)
Пример #6
0
 def __init__(self, ievent=None):
     EventBase.__init__(self, ievent)