chathistory.py 文件源码

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

项目:znc-chathistory 作者: MuffinMedic 项目源码 文件源码
def generate_batch(self, chathistory, target):
        if len(chathistory) > 0:
            # Generate a random alphanumeric BATCH ID
            batch_id = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for i in range(BATCH_ID_SIZE))
            # Place the BATCH start identifer to the beginning of the chathistory
            line = 'irc.znc.in BATCH +{} chathistory {}'.format(batch_id, target)
            self.send_chathistory(line)
            # Prepend the BATCH ID to each line from the chathistory
            for line in chathistory:
                #msg_id = uuid.uuid4()
                #line = '@batch={};draft/msgid={};{}'.format(batch_id, msg_id, line)
                line = '@batch={};{}'.format(batch_id, line)
                self.send_chathistory(line)
            # Place the BATCH end identifer to the beginning of the chathistory
            line = 'irc.znc.in BATCH -{}'.format(batch_id)
            self.send_chathistory(line)
        else:
            client = self.GetClient()
            self.send_error(client, 'ERR', 'NOT_FOUND')

    # Send the given line to the user
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号