Update src/main.py

This commit is contained in:
bvn13 2024-12-28 00:55:46 +03:00
parent 14f91fc512
commit 369086df76

View File

@ -17,6 +17,7 @@ delta = dt.timedelta(hours=3)
tz_msk = dt.timezone(offset=delta, name="MSK")
if __name__ == "__main__":
logger.info("Starting")
session_file = os.environ['SESSION_FILE']
app_id = int(os.environ['TG_APP_ID'])
api_hash = os.environ['TG_APP_HASH']
@ -31,6 +32,7 @@ if __name__ == "__main__":
owner_id=owner_id)
def start_bot():
logger.info("Starting bot")
asyncio.set_event_loop(asyncio.new_event_loop())
loop = asyncio.get_event_loop()
# Your asyncio code here
@ -63,7 +65,6 @@ if __name__ == "__main__":
schedule.exec_jobs()
time.sleep(1)
thread = threading.Thread(target=start_bot)
thread.start()
thread2 = threading.Thread(target=scheduled)