Untitled-1.py 文件源码

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

项目:turing-chat 作者: CosmoGao 项目源码 文件源码
def chgr_reply(msg):
    #print(msg)
    chcont=msg['Content']
    if chcont.find('revokemsg')>0:
        loc1=max(chcont.find('/oldmsgid&gt;&lt;msgid&gt;')+26,chcont.find('</oldmsgid><msgid>')+18)
        loc2=max(chcont.find('&lt;/msgid&gt;&lt;replacemsg&gt;&lt;![CDATA'),chcont.find('</msgid><replacemsg><![CDATA'))
        messageid=chcont[loc1:loc2]
        print(messageid)
        chtext=msg['Text']
        print(chtext)
        chlen=len(chtext)
        aname=chtext[:chlen-7]
        try:
            oritun=IDandTUN[str(messageid)]
            orifun=IDandFUN[str(messageid)]
        except:
            print('dont chehui twice')
        if (oritun==myusrname or orifun==myusrname)and (chtext.find('You')>0 or chtext.find('?')>0) or chtext=="You've recalled a message.":
            aname='myself'
        else:
            aname=aname + '[not me]'
        try:
            itchat.send("[Autoreply] The message revoked by '"+aname+"' just now is :"+IDandMESSAGE[str(messageid)],oritun)
            itchat.send("[Autoreply] The message revoked by '"+aname+"' just now is :"+IDandMESSAGE[str(messageid)],orifun)
        except:
            print("-----Can't find original msg")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号