From 6bc9887ebd1f41f0f1b873c6eb52791ae2e213ba Mon Sep 17 00:00:00 2001 From: filispeen <72784386+filispeen@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:40:42 +0300 Subject: [PATCH] Update webhook.py --- F_Discord_webhook/webhook.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/F_Discord_webhook/webhook.py b/F_Discord_webhook/webhook.py index 89016a9..a95f534 100644 --- a/F_Discord_webhook/webhook.py +++ b/F_Discord_webhook/webhook.py @@ -97,13 +97,14 @@ def on_file_created(event): observer.schedule(event_handler, path=directory, recursive=False) observer.start() -def main(turl): +def main(url): global webhook_availibility if not webhook_availibility: loop = asyncio.new_event_loop() # Create a new event loop asyncio.set_event_loop(loop) - loop.run_until_complete(av_test(turl)) + loop.run_until_complete(av_test(url)) loop.close() + webhook_availibility=True try: while True: time.sleep(1) @@ -112,7 +113,7 @@ def main(turl): observer.join() if __name__ == '__main__': - main(turl=url) + main(url)