yjlaugus

前提

  • 安装itchat 模块
  • python 环境

代码

import itchat
import datetime
import time
itchat.auto_login(hotReload=True)
user =itchat.search_chatrooms(name=u\'你的群名字\')
userName = user[0][u\'UserName\']
 
while 1:
     now = datetime.datetime.now()
     now_str =now.strftime(\'%Y-%m-%d %H:%M:%S\')[11:]
     
    # print(now_str)
     print(\'\r{}\'.format(now_str), end =\'\')
     if now_str in [\'08:05:00\']:
          itchat.send(\'自定义文本内容\',toUserName=userName)
          time.sleep(1) 
time.sleep(1) # 1秒发送三次  # 2秒发送四次
if __name__ == \'__main__\':
    itchar.auto_login()
    itchar.run()

分类:

技术点:

相关文章: