美文网首页
ITCHAT search_chatrooms 查找群失败的问

ITCHAT search_chatrooms 查找群失败的问

作者: 德徳_597b | 来源:发表于2019-02-12 08:31 被阅读0次

    使用 user_info = itchat.search_chatrooms(name='XXX') 查找群的时候,有时会遇到找不到的情况,需要在群设置选择-保存到通讯录,才能被查找到

    user_info = itchat.search_chatrooms(name='XXX')

        if len(user_info)==0:

          print(u'没有找到群')

        else:

          print(user_info)

          chatroomname=user_info[0]['UserName']

          print(user_info[0]['UserName'])

          itchat.send_msg("ceshi",chatroomname)

    相关文章

      网友评论

          本文标题:ITCHAT search_chatrooms 查找群失败的问

          本文链接:https://www.haomeiwen.com/subject/sukheqtx.html