import itchat,time
from itchat.content import *
itchat.auto_login(enableCmdQR=-1)
while True:
for i in range(1,10):
if i == 3:
friend_cijingchangcun = itchat.search_friends("此景长存") #获取个人字典信息
jiangxinlong=friend_cijingchangcun[0]["UserName"] #筛选个人信息
friend_danding = itchat.search_friends("淡定")
wangdong = friend_danding[0]["UserName"]
print(jiangxinlong)
friend_list=[wangdong,jiangxinlong]
content=i #发送的消息
for i in friend_list:
itchat.send_msg(msg=content,toUserName=i) #发送信息给微信好友
time.sleep(5)
elif i == 7:
friend_cijingchangcun = itchat.search_friends("此景长存") # 获取个人字典信息
jiangxinlong = friend_cijingchangcun[0]["UserName"] # 筛选个人信息
friend_danding = itchat.search_friends("淡定")
wangdong = friend_danding[0]["UserName"]
print(jiangxinlong)
friend_list = [wangdong, jiangxinlong]
content = i # 发送的消息
for i in friend_list:
itchat.send_msg(msg=content, toUserName=i) # 发送信息给微信好友
time.sleep(5)
else:
time.sleep(5)