# coding=UTF-8
import schedule
from wxpy import *
import sqlserver
import twilio_phone
import time
bot=Bot(cache_path=True) #缓存微信登录信息
#根据群名称,发送内容, 有可能该群搜索不到或报错,解决方法 :设置该群功能“保存通讯录"功能为打开状态
def SentChatRoomsMsg(name, context):
my_group = bot.groups().search(name)[0]
my_group.send(context)
def job():
group_list = ['开心']
content = 'hello world!' #处理内容
for group_name in group_list:
SentChatRoomsMsg(group_name, content)
print('sended msg to ' + group_name +"\n"+ " content: " + content+"\n")
schedule.every().day.at("19:32").do(job)
while True:
schedule.run_pending()
time.sleep(1)
bot.join()