randydev commited on
Commit
401e7d5
·
verified ·
1 Parent(s): ca5cd1f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -149,7 +149,7 @@ async def tiktok_downloader(client: Client, message: Message):
149
 
150
  async def setup():
151
  try:
152
- await client.start()
153
  logging.info("Bot started successfully")
154
  await start_periodic_task()
155
  # Run the client
@@ -157,4 +157,8 @@ async def setup():
157
  except Exception as e:
158
  logging.info(f"Error in setup: {e}")
159
 
160
- client.run(setup())
 
 
 
 
 
149
 
150
  async def setup():
151
  try:
152
+ await client.run()
153
  logging.info("Bot started successfully")
154
  await start_periodic_task()
155
  # Run the client
 
157
  except Exception as e:
158
  logging.info(f"Error in setup: {e}")
159
 
160
+ if __main__ == "__main__":
161
+ try:
162
+ await setup()
163
+ except Exception as e:
164
+ logging.info(str(e))