我不知道如何用python在多进程中使用python。我做一个线程,但如果这个线程没有完成机器人不能回答消息。在
horaPurga= now.replace(hour=23, minute=36,second=59,microsecond=0)
def purga(threading.Thread):
now = datetime.now()
if now >= horaPurga :
bot.send_message(cid, 'pole')
def run():
while True:
purga.start()
time.sleep(2)
尝试用@run_async:
请在此处阅读更多信息:
https://github.com/python-telegram-bot/python-telegram-bot/wiki/Performance-Optimizations
TLDR:
相关问题 更多 >
编程相关推荐