没有使用延迟发送func,python

时间:2017-09-21 08:50:20

标签: python datetime scheduled-tasks

调度程序必须在exect时间发送消息,但它可以毫不拖延地工作......出了什么问题?

import os
import time
import schedule
from slackclient import SlackClient

BOT_NAME = "nagfhght"
SLACK_API_TOKEN = "xoxb-ghhghgghhfe"
BOT_ID = "hgfhfghfg"

sc = SlackClient(SLACK_API_TOKEN)


def send_message(text):
    sc.api_call(
        "chat.postMessage",
        channel="#madchickens",
        text=text
    )


schedule.every().weekday.at("14:16").do(send_message, send_message("here time work"))

0 个答案:

没有答案