【发布时间】:2020-01-20 20:03:43
【问题描述】:
我正在尝试制作一个能够在每天特定时间通知用户的机器人。如何让机器人在每天的特定时间发送通知?
我尝试使用 while 循环,但它是
@bot.callback_query_handler(func=lambda c:True)
def CalendarAnswer(c):
Cid = c.message.chat.id
if c.data == 'ShowTime':
bot.send_message(Cid, timeToday)
if c.data == 'ShowDate':
bot.send_message(Cid, dateToday)
if c.data == 'SetNotification':
Ask = bot.send_message(Cid, 'Напиши мне время')
bot.register_next_step_handler(Ask,SettingNotificationTime)
def SettingNotificationTime(message):
NotificationTime = message.text
bot.send_message(message.chat.id, "that's your time:" + NotificationTime)v
我不知道如何解决我的问题
【问题讨论】:
-
at 或 cron 怎么样?
-
你在说什么?
标签: python python-3.x telegram-bot python-telegram-bot