teddy 96e67e8b04 feat: 初始化微信自动消息发送项目
添加项目基础文件结构,包括:
- README.md 占位文件
- Python 版本配置文件
- gitignore 配置
- 项目配置文件
- 项目依赖配置
- 定时任务调度器
- 微信消息发送主逻辑
- 飞书消息通知功能
2025-06-20 17:39:03 +08:00

37 lines
778 B
Python

from wxauto import WeChat
from datetime import date
import sys
import os
import subprocess
import json
from config import CONFIG
import time
today = date.today()
formatted_date = today.strftime('%Y-%m-%d')
file_name = formatted_date+".png"
file_path = CONFIG['file_path']+file_name
try:
wx = WeChat()
except:
#运行send_openmsg.py
subprocess.run([sys.executable, 'send_openmsg.py'])
sys.exit(1)
msg = 'hello, wxauto!'
who = 'File Transfer'
if os.path.isfile(file_path):
error_msg = ""
else:
error_msg = "没找到指定文件"
#运行send_filemsg.py
subprocess.run([sys.executable, 'send_filemsg.py'])
sys.exit(1)
print("找到了指定文件!")
wx.SendFiles(filepath=file_path, who="File Transfer")
wx.SendMsg(msg=msg, who=who)