Update src/main.py
This commit is contained in:
parent
14f91fc512
commit
369086df76
@ -17,6 +17,7 @@ delta = dt.timedelta(hours=3)
|
|||||||
tz_msk = dt.timezone(offset=delta, name="MSK")
|
tz_msk = dt.timezone(offset=delta, name="MSK")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
logger.info("Starting")
|
||||||
session_file = os.environ['SESSION_FILE']
|
session_file = os.environ['SESSION_FILE']
|
||||||
app_id = int(os.environ['TG_APP_ID'])
|
app_id = int(os.environ['TG_APP_ID'])
|
||||||
api_hash = os.environ['TG_APP_HASH']
|
api_hash = os.environ['TG_APP_HASH']
|
||||||
@ -31,6 +32,7 @@ if __name__ == "__main__":
|
|||||||
owner_id=owner_id)
|
owner_id=owner_id)
|
||||||
|
|
||||||
def start_bot():
|
def start_bot():
|
||||||
|
logger.info("Starting bot")
|
||||||
asyncio.set_event_loop(asyncio.new_event_loop())
|
asyncio.set_event_loop(asyncio.new_event_loop())
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
# Your asyncio code here
|
# Your asyncio code here
|
||||||
@ -63,7 +65,6 @@ if __name__ == "__main__":
|
|||||||
schedule.exec_jobs()
|
schedule.exec_jobs()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
thread = threading.Thread(target=start_bot)
|
thread = threading.Thread(target=start_bot)
|
||||||
thread.start()
|
thread.start()
|
||||||
thread2 = threading.Thread(target=scheduled)
|
thread2 = threading.Thread(target=scheduled)
|
||||||
|
Loading…
Reference in New Issue
Block a user