Skip to content

Commit

Permalink
typo correction
Browse files Browse the repository at this point in the history
  • Loading branch information
kanewi11 committed Nov 10, 2022
1 parent 999b741 commit 876f835
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class SessionConvertor:
def __init__(self, session_path: Path, config: Dict, work_dir: Path):
self.session_path = session_path
self.inappropriate_sessions_path = work_dir.joinpath('unnecessary_sessions')
self.app_id = config['app_id']
self.app_hash = config['app_hash']
self.api_id = config['api_id']
self.api_hash = config['api_hash']
self.work_dir = work_dir

async def convert(self) -> None:
Expand All @@ -33,7 +33,7 @@ async def move_file_to_unnecessary(self, file_path: Path):

async def __get_data_telethon_session(self) -> Tuple[User, StringSession]:
"""Get User and StringSession"""
async with TelegramClient(self.session_path.with_suffix('').__str__(), self.app_id, self.app_hash) as client:
async with TelegramClient(self.session_path.with_suffix('').__str__(), self.api_id, self.api_hash) as client:
user_data = await client.get_me()
string_session = StringSession.save(client.session)
session_data = StringSession(string_session)
Expand All @@ -42,8 +42,8 @@ async def __get_data_telethon_session(self) -> Tuple[User, StringSession]:
async def __save_pyrogram_session_file(self, session_string: Union[str, Coroutine[Any, Any, str]],
session_data: StringSession):
"""Create session file for pyrogram"""
async with Client(self.session_path.stem, session_string=session_string, api_id=self.app_id,
api_hash=self.app_hash, workdir=self.work_dir.__str__()) as client:
async with Client(self.session_path.stem, session_string=session_string, api_id=self.api_id,
api_hash=self.api_hash, workdir=self.work_dir.__str__()) as client:
user_data = await client.get_me()
client.storage = FileStorage(self.session_path.stem, self.work_dir)
client.storage.conn = sqlite3.Connection(self.session_path)
Expand Down

0 comments on commit 876f835

Please sign in to comment.