每个人。 我使用PyTeleBot和Schedule做一些事情,现在我需要每天00:00发送一条消息。我已经用bot.polling设置了时间表,顺便说一句。
@bot.message_handler(content_types=['text'])
**def job(message):
bot.send_message(message.chat.id, "2")**
@bot.message_handler(commands=['start'])
def start_message(message):
some code
def runBot():
bot.polling()
def runSchedulers():
schedule.every(00:00).do(job)
while True:
schedule.run_pending()
time.sleep(1)
if __name__ == "__main__":
t1 = threading.Thread(target=runBot)
t2 = threading.Thread(target=runSchedulers)
# starting thread 1
t1.start()
# starting thread 2
t2.start()
TypeError:job()缺少1个必需的位置参数:“ message”
预先感谢