python不会延迟发送func

2024-05-15 09:45:33 发布

您现在位置:Python中文网/ 问答频道 /正文

调度程序必须在执行时发送消息,但它不会延迟。。。怎么了

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"))

Tags: textimport程序tokensendapi消息message