Update main.py
Browse files
main.py
CHANGED
@@ -4,6 +4,7 @@ import requests
|
|
4 |
from bs4 import BeautifulSoup
|
5 |
from contextlib import asynccontextmanager
|
6 |
from akenoai import AkenoXToJs as js
|
|
|
7 |
from akenoai.runner import run_fast
|
8 |
from fastapi.middleware.cors import CORSMiddleware
|
9 |
from config import API_ID, API_HASH, BOT_TOKEN, SESSION
|
@@ -16,14 +17,14 @@ logger.setLevel(logging.DEBUG)
|
|
16 |
fast_app = js.get_app()
|
17 |
js.add_cors_middleware()
|
18 |
|
19 |
-
client =
|
20 |
name="fastapi-bot",
|
21 |
api_id=API_ID,
|
22 |
api_hash=API_HASH,
|
23 |
bot_token=BOT_TOKEN
|
24 |
)
|
25 |
|
26 |
-
user_client =
|
27 |
name="fastapi-user",
|
28 |
api_id=API_ID,
|
29 |
api_hash=API_HASH,
|
@@ -186,7 +187,6 @@ async def get_user(user_id=None):
|
|
186 |
try:
|
187 |
get_users = await client.get_users(user_id)
|
188 |
response = await js.get_creation_date(
|
189 |
-
api_key="akeno_OSrXhljIomunACd5JY18jFIeIuuB6Pdx",
|
190 |
user_id=get_users.id
|
191 |
)
|
192 |
except Exception:
|
|
|
4 |
from bs4 import BeautifulSoup
|
5 |
from contextlib import asynccontextmanager
|
6 |
from akenoai import AkenoXToJs as js
|
7 |
+
from akenoai.runner import create_pyrogram
|
8 |
from akenoai.runner import run_fast
|
9 |
from fastapi.middleware.cors import CORSMiddleware
|
10 |
from config import API_ID, API_HASH, BOT_TOKEN, SESSION
|
|
|
17 |
fast_app = js.get_app()
|
18 |
js.add_cors_middleware()
|
19 |
|
20 |
+
client = create_pyrogram(
|
21 |
name="fastapi-bot",
|
22 |
api_id=API_ID,
|
23 |
api_hash=API_HASH,
|
24 |
bot_token=BOT_TOKEN
|
25 |
)
|
26 |
|
27 |
+
user_client = create_pyrogram(
|
28 |
name="fastapi-user",
|
29 |
api_id=API_ID,
|
30 |
api_hash=API_HASH,
|
|
|
187 |
try:
|
188 |
get_users = await client.get_users(user_id)
|
189 |
response = await js.get_creation_date(
|
|
|
190 |
user_id=get_users.id
|
191 |
)
|
192 |
except Exception:
|