From 9bb0501ea85cb9a2c5758de3cbba8ea1bdf4c787 Mon Sep 17 00:00:00 2001 From: Panoramic Date: Wed, 3 Jul 2024 08:44:48 +0300 Subject: [PATCH] Fix `TypeError: 'module' object is not callable` --- pyproject.toml | 2 +- vetting_bot/main.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0797498..7b313de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ license = "AGPL-3.0-or-later" readme = "README.md" [tool.poetry.scripts] -vetting-bot = "vetting_bot:main" +vetting-bot = "vetting_bot.main:run" [tool.poetry.dependencies] python = "^3.11" diff --git a/vetting_bot/main.py b/vetting_bot/main.py index 9ee0570..4d63053 100644 --- a/vetting_bot/main.py +++ b/vetting_bot/main.py @@ -131,5 +131,6 @@ async def main(): await client.close() -# Run the main function in an asyncio event loop -asyncio.get_event_loop().run_until_complete(main()) +def run(): + # Run the main function in an asyncio event loop + asyncio.get_event_loop().run_until_complete(main())