LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
9.68k stars 1.38k forks source link

Can't send code because python not reading string #3961

Closed lynrayy closed 1 year ago

lynrayy commented 1 year ago

Checklist

Code that causes the issue

from telethon import TelegramClient, events, sync

api_id = 12345678
api_hash = '123456123456123456'
session_name = "Ray's userbot"

client = TelegramClient('session_name', api_id, api_hash)
client.start()

Traceback

--

Python just not reading line with code and creating new lines in pressing ENTER https://youtu.be/B5zhr6Qgi8c

lynrayy commented 1 year ago

P.s This is PyCharm

Lonami commented 1 year ago

If you have 2FA enabled the prompt to enter your password may not show in some terminals but you should still be able to type in the password and press enter to login. Alternatively, provide the password to start. Unfortunately this can't really be fixed while keeping the interactive password hidden as far as I know.

lynrayy commented 1 year ago

Have you seen video? Enter does nothing

Lonami commented 1 year ago

Yes I have seen the video. As I said you can enter the 2FA directly in the code, or use the manual login flow without start (see docs), or, if there's a bug, I would need logging.DEBUG to be enabled to tell.