return contents.split(" ") def send(msg): pyperclip.copy(msg) # 复制需要发送的内容到粘贴板 pyautogui.hotkey('ctrl', 'v') # 模拟键盘 ctrl + v 粘贴内容 pyautogui.press('enter') # 发送消息 def send_msg(friend): pyautogui.hotkey('ctrl', 'alt', 'w') # Ctrl + alt + w 打开...
调用微信接口发送消息 # 4.1 通过用户id发送信息 itchat.send(send_message, userid) # 4.2 发送纯文本信息 itchat.send_msg(msg=send_message, toUserName=userid) except Exception as e: print("消息发送异常:", e) finally: # 退出微信 itchat.logout() 2、批量发送import itchat class SendWeChat()...
logInfo(f"当前发送消息{item}") send_message(item["nickname"],item["content"]) # 调用接口 更新消息发送状态 updateWxMessageStatus(item["id"]) exceptExceptionasex: logError(f"main消息异常:{str(ex)}",ex) # sys.exit(0) # 发送消息 defsend_message(target,message,delay=1): try: time.sle...
然后就可以通过 send_msg 函数发送消息了。 wechat = WeChatPub() now = datetime.datetime.now() timenow = now.strftime('%Y年%m月%d日 %H:%M:%S') wechat.send_msg(f"{timenow} 阿里云 cookie 已失效请尽快更换新的 cookie") 只要你的企业微信没有关闭通知的权限,那你的手机立马就会弹出这个告警信...
]print(dq_message.dataList)#设置日志输出格式和保存路径logging.basicConfig(filename='send_msg.log', format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)whileTrue:#获取当前时间start_time =datetime.now()#构造并发送数据包message =dq_message.to_byte_buf(self.is_multi_tab...
然后就可以通过 send_msg 函数发送消息了。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 wechat=WeChatPub()now=datetime.datetime.now()timenow=now.strftime('%Y年%m月%d日 %H:%M:%S')wechat.send_msg(f"{timenow} 阿里云 cookie 已失效请尽快更换新的 cookie") 只要你的企业微信没有关闭通知...
+ '发送时间:' + dt + '\n' + '撤回了一条语音' itchat.send(send_msg, 'filehelper') ...
wx.SendMsg(msg) # 发送消息:你是不是该喝水了呢~ pyautogui.click(-149, 602) # 关闭微信,此坐标位置为电脑中微信的右上角关闭位置 if __name__ == '__main__': scheduler = BlockingScheduler(timezone="Asia/Shanghai") # 时域 scheduler.add_job(send_message, 'cron', month='8-11', hour...
wechat.send_msg(f"{timenow} 注意!今日有新债,坚持打新!") print('消息已发送!') 4、实现效果: 大家好,这是我开发的机器人公众号小号,目前增加了天气查询,955公司名单,关注时间查询;后面还会增加图片功能和每日送书抽奖送书活动,以及调戏功能,欢迎来体验,捧场。 一个机器人公众号已经上线,欢迎调戏 入门:最...
# 连服务器50smtp.login(sender,password)51except:52smtp=smtplib.SMTP_SSL(smtpserver,port)53smtp.login(sender,password)# 登录54smtp.sendmail(sender,receiver,msg.as_string())# 发送55smtp.quit()5657if__name__=="__main__":58#本地文件的路径59att_path=r'E:\pythontest\text.txt'60send_mail...