使用 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)
作者:德徳_597b
链接:https://www.jianshu.com/p/c8b164b840db
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
网友评论