{"action":"created","issue":{"url":"https://api.github.com/repos/LonamiWebs/Telethon/issues/1024","repository_url":"https://api.github.com/repos/LonamiWebs/Telethon","labels_url":"https://api.github.com/repos/LonamiWebs/Telethon/issues/1024/labels{/name}","comments_url":"https://api.github.com/repos/LonamiWebs/Telethon/issues/1024/comments","events_url":"https://api.github.com/repos/LonamiWebs/Telethon/issues/1024/events","html_url":"https://github.com/LonamiWebs/Telethon/issues/1024","id":371696630,"node_id":"MDU6SXNzdWUzNzE2OTY2MzA=","number":1024,"title":"Regression: get_entity('me') no longer works","user":{"login":"gentoo-root","id":862550,"node_id":"MDQ6VXNlcjg2MjU1MA==","avatar_url":"https://avatars0.githubusercontent.com/u/862550?v=4","gravatar_id":"","url":"https://api.github.com/users/gentoo-root","html_url":"https://github.com/gentoo-root","followers_url":"https://api.github.com/users/gentoo-root/followers","following_url":"https://api.github.com/users/gentoo-root/following{/other_user}","gists_url":"https://api.github.com/users/gentoo-root/gists{/gist_id}","starred_url":"https://api.github.com/users/gentoo-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gentoo-root/subscriptions","organizations_url":"https://api.github.com/users/gentoo-root/orgs","repos_url":"https://api.github.com/users/gentoo-root/repos","events_url":"https://api.github.com/users/gentoo-root/events{/privacy}","received_events_url":"https://api.github.com/users/gentoo-root/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-18T20:22:02Z","updated_at":"2018-10-19T09:34:02Z","closed_at":null,"author_association":"NONE","body":"'me' and 'self' used to be special parameters to `get_entity()` that returned the current user (the same effect as `get_me()`). The following code used to work, however, it broke in some newer version, and now an exception is thrown:\r\n\r\n```\r\nfrom telethon import TelegramClient\r\nclient = TelegramClient('test', API_ID, API_HASH)\r\nclient.start()\r\nclient.get_entity('me')\r\n```\r\n\r\n_get_entity_from_string [still contains](https://github.com/LonamiWebs/Telethon/blob/e5fc9d8674c36c4bb91451145e94e58fb676f85d/telethon/client/users.py#L379) handling of 'me' and 'self', but [parse_username](https://github.com/LonamiWebs/Telethon/blob/e5fc9d8674c36c4bb91451145e94e58fb676f85d/telethon/utils.py#L651) returns None [here](https://github.com/LonamiWebs/Telethon/blob/e5fc9d8674c36c4bb91451145e94e58fb676f85d/telethon/client/users.py#L366) when called with 'me' as a parameter. I think the culprit is VALID_USERNAME_RE that doesn't include 'me' and 'self'.\r\n\r\nSteps to reproduce: Run the code snippet above (substitute API_ID and API_HASH with real values).\r\n\r\nExpected result: No exception is thrown; `get_entity('me')` returns the same as `get_me()`.\r\n\r\nActual result: An exception is thrown: `ValueError: Cannot find any entity corresponding to \"me\"`."},"comment":{"url":"https://api.github.com/repos/LonamiWebs/Telethon/issues/comments/431304732","html_url":"https://github.com/LonamiWebs/Telethon/issues/1024#issuecomment-431304732","issue_url":"https://api.github.com/repos/LonamiWebs/Telethon/issues/1024","id":431304732,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTMwNDczMg==","user":{"login":"Lonami","id":6297805,"node_id":"MDQ6VXNlcjYyOTc4MDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6297805?v=4","gravatar_id":"","url":"https://api.github.com/users/Lonami","html_url":"https://github.com/Lonami","followers_url":"https://api.github.com/users/Lonami/followers","following_url":"https://api.github.com/users/Lonami/following{/other_user}","gists_url":"https://api.github.com/users/Lonami/gists{/gist_id}","starred_url":"https://api.github.com/users/Lonami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lonami/subscriptions","organizations_url":"https://api.github.com/users/Lonami/orgs","repos_url":"https://api.github.com/users/Lonami/repos","events_url":"https://api.github.com/users/Lonami/events{/privacy}","received_events_url":"https://api.github.com/users/Lonami/received_events","type":"User","site_admin":false},"created_at":"2018-10-19T09:34:02Z","updated_at":"2018-10-19T09:34:02Z","author_association":"MEMBER","body":"It had been such a long time since I last got an actual *bug* report :-)"}}
{"actor":{"display_login":"Lonami"}}