调度代码失败

时间:2018-04-20 00:23:35

标签: python scheduler chatbot

我试图让我的聊天机器人每天在特定时间发送消息,但我没有做到这一点。你看到我的代码有什么问题吗?

我试图运行的功能是"发送消息"

import schedule
import time

def daily_message():
  msg = "Hello Everyone, I'm a bot, please use me to notify people that need things on this channel. Right now, you can type @Ditto: Rob and Jackie, @Ghost: Rob @Rare: Mitch, Corey, Abhinay, Sabre, Sam-B @Quest: Mitch, Corey, Abhinay. Contact Corey to be added or deleted from a list " 
  usrID= 0,0
  locid= [0, 0],[0, 0]
  send_message(msg, usrID, locid)


schedule.every().day.at("20:18").do(daily_message)
schedule.every().day.at("20:04").send_message(daily_message)


while True:
  schedule.run_pending()
  time.sleep(1)

谢谢你有一个美好的一天

PS:这是完整的代码:https://github.com/coreyboulet/testbot

PPS:我在编码方面真的很陌生,如果这是一个愚蠢的问题,我的目的是但我无法在互联网上找到或做任何工作

0 个答案:

没有答案