2021-05-05 02:59:30 +00:00
|
|
|
from telegram.ext import Updater
|
|
|
|
from config import TOKEN
|
2021-05-05 08:13:28 +00:00
|
|
|
from func import start_handler, chat_content_handler, check_schedule
|
|
|
|
import schedule
|
2021-05-05 08:21:06 +00:00
|
|
|
from task import do_task
|
2021-05-05 08:13:28 +00:00
|
|
|
import threading
|
|
|
|
|
2021-05-05 08:27:21 +00:00
|
|
|
schedule.every().day.at('16:20').do(do_task).tag('task')
|
|
|
|
# schedule.every(1).minutes.do(do_task).tag('task')
|
2021-05-05 08:13:28 +00:00
|
|
|
|
|
|
|
threading.Thread(target=check_schedule).start()
|
2021-05-05 02:59:30 +00:00
|
|
|
|
|
|
|
updater = Updater(token=TOKEN, use_context=True)
|
|
|
|
dispatcher = updater.dispatcher
|
|
|
|
|
|
|
|
dispatcher.add_handler(start_handler)
|
2021-05-05 03:10:01 +00:00
|
|
|
dispatcher.add_handler(chat_content_handler)
|
2021-05-05 02:59:30 +00:00
|
|
|
|
|
|
|
updater.start_polling()
|
|
|
|
updater.idle()
|