예제 #1
0
파일: irc.py 프로젝트: code2u/jsb
def handle_broadcast(bot, ievent):
    """ arguments: <txt> - broadcast txt to all joined channels. """
    if not ievent.rest:
         ievent.missing('<txt>')
         return
    ievent.reply('broadcasting')
    getfleet().broadcast(ievent.rest)
    partyline.say_broadcast(ievent.rest)
    ievent.reply('done')
예제 #2
0
def handle_broadcast(bot, ievent):
    """ arguments: <txt> - broadcast txt to all joined channels. """
    if not ievent.rest:
         ievent.missing('<txt>')
         return
    ievent.reply('broadcasting')
    getfleet().broadcast(ievent.rest)
    partyline.say_broadcast(ievent.rest)
    ievent.reply('done')
예제 #3
0
파일: bot.py 프로젝트: Lujeni/old-projects
             ievent.iscommand = True
             ievent.showall = True
             ievent.nodispatch = False
             ievent.bind()
             self.put(ievent)
             continue
         elif ievent.txt[0] == "@":
             partyline.say_broadcast_notself(ievent.nick, "[%s] %s" % (ievent.nick, ievent.txt))
             q = Queue.Queue()
             ievent.queues = [q]
             ievent.txt = ievent.txt[1:]
             self.doevent(ievent)
             result = waitforqueue(q, 3000)
             if result:
                 for i in result:
                     partyline.say_broadcast("[bot] %s" % i)
             continue
         else:
             partyline.say_broadcast_notself(ievent.nick, "[%s] %s" % (ievent.nick, ievent.txt))
     except socket.error, ex:
         try:
             (errno, errstr) = ex
         except:
             errno = 0
             errstr = str(ex)
         if errno == 35 or errno == 11:
             continue
     except Exception, ex:
         handle_exception()
 sockfile.close()
 logging.warn('closing dcc with %s (%s)' %  (nick, self.cfg.name))
예제 #4
0
파일: bot.py 프로젝트: Petraea/jsonbot
             ievent.iscommand = True
             ievent.showall = True
             ievent.nodispatch = False
             ievent.bind()
             self.put(ievent)
             continue
         elif ievent.txt[0] == "@":
             partyline.say_broadcast_notself(ievent.nick, "[%s] %s" % (ievent.nick, ievent.txt))
             q = Queue.Queue()
             ievent.queues = [q]
             ievent.txt = ievent.txt[1:]
             self.doevent(ievent)
             result = waitforqueue(q, 3000)
             if result:
                 for i in result:
                     partyline.say_broadcast("[bot] %s" % i)
             continue
         else:
             partyline.say_broadcast_notself(ievent.nick, "[%s] %s" % (ievent.nick, ievent.txt))
     except socket.error, ex:
         try:
             (errno, errstr) = ex
         except:
             errno = 0
             errstr = str(ex)
         if errno == 35 or errno == 11:
             continue
     except Exception, ex:
         handle_exception()
 sockfile.close()
 logging.warn('closing dcc with %s (%s)' %  (nick, self.cfg.name))