Upload __main__.py
Browse files- Akeno/__main__.py +5 -1
Akeno/__main__.py
CHANGED
@@ -22,12 +22,14 @@ import importlib
|
|
22 |
import logging
|
23 |
import sys
|
24 |
from contextlib import closing, suppress
|
|
|
25 |
|
26 |
from pyrogram import idle
|
27 |
from pyrogram.errors import *
|
28 |
from uvloop import install
|
29 |
|
30 |
from Akeno import clients
|
|
|
31 |
from Akeno.utils.database import db
|
32 |
from Akeno.utils.logger import LOGS
|
33 |
|
@@ -39,6 +41,8 @@ loop = asyncio.get_event_loop()
|
|
39 |
async def main():
|
40 |
try:
|
41 |
await db.connect()
|
|
|
|
|
42 |
for cli in clients:
|
43 |
try:
|
44 |
await cli.start()
|
@@ -76,4 +80,4 @@ if __name__ == "__main__":
|
|
76 |
with closing(loop):
|
77 |
with suppress(asyncio.exceptions.CancelledError):
|
78 |
loop.run_until_complete(main())
|
79 |
-
loop.run_until_complete(asyncio.sleep(3.0))
|
|
|
22 |
import logging
|
23 |
import sys
|
24 |
from contextlib import closing, suppress
|
25 |
+
from importlib import import_module
|
26 |
|
27 |
from pyrogram import idle
|
28 |
from pyrogram.errors import *
|
29 |
from uvloop import install
|
30 |
|
31 |
from Akeno import clients
|
32 |
+
from Akeno.plugins import ALL_MODULES
|
33 |
from Akeno.utils.database import db
|
34 |
from Akeno.utils.logger import LOGS
|
35 |
|
|
|
41 |
async def main():
|
42 |
try:
|
43 |
await db.connect()
|
44 |
+
for module_name in ALL_MODULES:
|
45 |
+
imported_module = import_module(f"Akeno.plugins.{module_name}")
|
46 |
for cli in clients:
|
47 |
try:
|
48 |
await cli.start()
|
|
|
80 |
with closing(loop):
|
81 |
with suppress(asyncio.exceptions.CancelledError):
|
82 |
loop.run_until_complete(main())
|
83 |
+
loop.run_until_complete(asyncio.sleep(3.0))
|