Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -21,6 +21,7 @@ import requests
|
|
21 |
import time
|
22 |
import json
|
23 |
import asyncio
|
|
|
24 |
import io
|
25 |
import os
|
26 |
import re
|
@@ -39,6 +40,11 @@ from google.api_core.exceptions import InvalidArgument
|
|
39 |
from database import db
|
40 |
from logger import LOGS
|
41 |
|
|
|
|
|
|
|
|
|
|
|
42 |
load_dotenv()
|
43 |
API_ID = os.environ["API_ID"]
|
44 |
API_HASH = os.environ["API_HASH"]
|
@@ -71,7 +77,6 @@ async def geni_files_delete(name: str):
|
|
71 |
| filters.regex(r"\b(Randy|Rendi)\b(.*)", flags=re.IGNORECASE)
|
72 |
)
|
73 |
& filters.private
|
74 |
-
& ~filters.bot
|
75 |
& ~filters.via_bot
|
76 |
& ~filters.forwarded,
|
77 |
group=2,
|
@@ -263,5 +268,5 @@ async def main():
|
|
263 |
me = await client.get_me()
|
264 |
LOGS.info(f"started bot: {me.first_name}")
|
265 |
|
266 |
-
if __name__ == "
|
267 |
-
|
|
|
21 |
import time
|
22 |
import json
|
23 |
import asyncio
|
24 |
+
import logging
|
25 |
import io
|
26 |
import os
|
27 |
import re
|
|
|
40 |
from database import db
|
41 |
from logger import LOGS
|
42 |
|
43 |
+
logging.basicConfig(level=logging.INFO)
|
44 |
+
logging.getLogger("pyrogram.syncer").setLevel(logging.WARNING)
|
45 |
+
logging.getLogger("pyrogram.client").setLevel(logging.WARNING)
|
46 |
+
loop = asyncio.get_event_loop()
|
47 |
+
|
48 |
load_dotenv()
|
49 |
API_ID = os.environ["API_ID"]
|
50 |
API_HASH = os.environ["API_HASH"]
|
|
|
77 |
| filters.regex(r"\b(Randy|Rendi)\b(.*)", flags=re.IGNORECASE)
|
78 |
)
|
79 |
& filters.private
|
|
|
80 |
& ~filters.via_bot
|
81 |
& ~filters.forwarded,
|
82 |
group=2,
|
|
|
268 |
me = await client.get_me()
|
269 |
LOGS.info(f"started bot: {me.first_name}")
|
270 |
|
271 |
+
if __name__ == "__main__":
|
272 |
+
loop.run_until_complete(main())
|