simple_irc_bot.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:irc_bot 作者: cvium 项目源码 文件源码
def start(self):
        """The main loop keeping the bot alive"""
        self.connect(self.current_server)
        while self.running:
            # No need to busy-wait
            time.sleep(0.2)
            self.schedule.execute()
            # Skip polling etc. if we're reconnecting
            if self.reconnecting and not self.connected:
                continue
            try:
                asyncore.poll(timeout=10, map={self.socket: self})
            except socket.error as e:
                log.error(e)
                self.reconnect_with_delay()
                continue
            dc_channels = self.disconnected_channels()
            if dc_channels:
                self.join(dc_channels, delay=5)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号