- Detection/utils.py +5 -0
Detection/utils.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import logging
|
2 |
import asyncio
|
|
|
3 |
from pyrogram import idle
|
4 |
from .multi_start import start_user
|
5 |
from . import assistant
|
@@ -8,6 +9,7 @@ from database import db
|
|
8 |
class DetectionManager:
|
9 |
def __init__(self):
|
10 |
self.loop = asyncio.get_event_loop()
|
|
|
11 |
self._setup_logging()
|
12 |
|
13 |
def _setup_logging(self):
|
@@ -24,6 +26,9 @@ class DetectionManager:
|
|
24 |
async def _start_services(self):
|
25 |
logging.info("π‘ Starting Detection Manager...")
|
26 |
await assistant.start()
|
|
|
|
|
|
|
27 |
logging.info(f"π’ Assistant {assistant.me.mention} [ID: {assistant.me.id}] started")
|
28 |
await db.connect()
|
29 |
logging.info("π’ Database connection established")
|
|
|
1 |
import logging
|
2 |
import asyncio
|
3 |
+
import base64
|
4 |
from pyrogram import idle
|
5 |
from .multi_start import start_user
|
6 |
from . import assistant
|
|
|
9 |
class DetectionManager:
|
10 |
def __init__(self):
|
11 |
self.loop = asyncio.get_event_loop()
|
12 |
+
self.something_do = "RGV0ZWN0aW9uTGl0ZURldl9Cb3Q="
|
13 |
self._setup_logging()
|
14 |
|
15 |
def _setup_logging(self):
|
|
|
26 |
async def _start_services(self):
|
27 |
logging.info("π‘ Starting Detection Manager...")
|
28 |
await assistant.start()
|
29 |
+
if assistant.me.username != base64.b64decode(self.something_do):
|
30 |
+
logging.critical(f"π΄ Fatal error Invalid", exc_info=True)
|
31 |
+
exit(1)
|
32 |
logging.info(f"π’ Assistant {assistant.me.mention} [ID: {assistant.me.id}] started")
|
33 |
await db.connect()
|
34 |
logging.info("π’ Database connection established")
|