word_cloud_bot/main.py
机器人总动员 68a614e2c5 init
2021-05-05 16:27:21 +08:00

21 lines
550 B
Python

from telegram.ext import Updater
from config import TOKEN
from func import start_handler, chat_content_handler, check_schedule
import schedule
from task import do_task
import threading
schedule.every().day.at('16:20').do(do_task).tag('task')
# schedule.every(1).minutes.do(do_task).tag('task')
threading.Thread(target=check_schedule).start()
updater = Updater(token=TOKEN, use_context=True)
dispatcher = updater.dispatcher
dispatcher.add_handler(start_handler)
dispatcher.add_handler(chat_content_handler)
updater.start_polling()
updater.idle()