Answer the question
In order to leave comments, you need to log in
How to use telethon private proxies?
class TG(object):
def __init__(self, sessionFile: str, apiId: str, apiHash: str, proxy = None) -> None:
self.sessionFile = sessionFile
self.apiId = apiId
self.apiHash = apiHash
self.proxy = proxy
self.client: TelegramClient = None
async def auth(self) -> None:
self.client = TelegramClient(session=self.sessionFile,
api_id=self.apiId,
api_hash=self.apiHash,
proxy=self.proxy)
await self.client.start()
async def changeUserData(self) -> None:
await self.client(functions.account.UpdateProfileRequest(
first_name=random.choice(Files.Files.readFile(os.path.join(os.getcwd(), 'data', 'names.txt'))),
last_name=random.choice(Files.Files.readFile(os.path.join(os.getcwd(), 'data', 'surnames.txt'))),
))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question