Full-featured Telegram client library for Python 3
Project Links
Meta
Author: Lonami Exo
Requires Python: >=3.5
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
Topic
- Communications :: Chat
License
- OSI Approved :: MIT License
Programming Language
- Python :: 3
- Python :: 3.5
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
⭐️ Thanks everyone who has starred the project, it means a lot!
Telethon is an asyncio Python 3
MTProto library to interact with Telegram’s API
as a user or through a bot account (bot API alternative).
What is this?
Telegram is a popular messaging application. This library is meant to make it easy for you to write Python programs that can interact with Telegram. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application.
Installing
pip3 install telethon
Creating a client
from telethon import TelegramClient, events, sync
# These example values won't work. You must get your own api_id and
# api_hash from https://my.telegram.org, under API Development.
api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'
client = TelegramClient('session_name', api_id, api_hash)
client.start()
Doing stuff
print(client.get_me().stringify())
client.send_message('username', 'Hello! Talking to you from Telethon')
client.send_file('username', '/home/myself/Pictures/holidays.jpg')
client.download_profile_photo('me')
messages = client.get_messages('username')
messages[0].download_media()
@client.on(events.NewMessage(pattern='(?i)hi|hello'))
async def handler(event):
await event.respond('Hey!')
Next steps
Do you like how Telethon looks? Check out Read The Docs for a more in-depth explanation, with examples, troubleshooting issues, and more useful information.
1.42.0
Nov 05, 2025
1.41.2
Sep 04, 2025
1.41.1
Sep 04, 2025
1.41.0
Sep 01, 2025
1.40.0
Apr 21, 2025
1.39.0
Feb 20, 2025
1.38.1
Nov 18, 2024
1.38.0
Nov 17, 2024
1.37.0
Sep 23, 2024
1.36.0
Jun 11, 2024
1.35.0
Apr 24, 2024
1.34.0
Feb 02, 2024
1.33.1
Dec 08, 2023
1.33.0
Dec 01, 2023
1.32.1
Nov 12, 2023
1.32.0
Oct 31, 2023
1.31.1
Oct 17, 2023
1.31.0
Oct 12, 2023
1.30.3
Sep 13, 2023
1.30.2
Sep 12, 2023
1.30.1
Sep 12, 2023
1.30.0
Sep 10, 2023
1.29.3
Aug 18, 2023
1.29.2
Jul 24, 2023
1.29.1
Jul 23, 2023
1.29.0
Jul 23, 2023
1.28.5
Apr 14, 2023
1.28.2
Apr 07, 2023
1.28.1
Apr 06, 2023
1.28.0
Apr 06, 2023
1.27.0
Feb 05, 2023
1.26.1
Dec 22, 2022
1.26.0
Nov 25, 2022
1.25.4
Oct 14, 2022
1.25.3
Oct 14, 2022
1.25.2
Sep 27, 2022
1.25.1
Sep 24, 2022
1.25.0
Aug 30, 2022
1.24.0
Dec 01, 2021
1.23.0
Jul 09, 2021
1.22.0
Jun 19, 2021
1.21.1
Mar 16, 2021
1.21
Mar 14, 2021
1.20
Feb 27, 2021
1.19.5
Feb 08, 2021
1.19.4
Feb 06, 2021
1.19.3
Feb 06, 2021
1.19.2
Feb 02, 2021
1.19.1
Jan 26, 2021
1.19.0
Jan 05, 2021
1.18.2
Nov 28, 2020
1.18.1
Nov 28, 2020
1.18.0
Nov 28, 2020
1.17.5
Oct 25, 2020
1.17.4
Oct 23, 2020
1.17.3
Oct 23, 2020
1.17.2
Oct 23, 2020
1.17.1
Oct 22, 2020
1.17.0
Oct 18, 2020
1.16.4
Aug 24, 2020
1.16.3
Aug 24, 2020
1.16.2
Aug 11, 2020
1.16.1
Aug 10, 2020
1.16.0
Jul 28, 2020
1.15.0
Jul 04, 2020
1.14.0
May 26, 2020
1.13.0
Apr 25, 2020
1.12.0
Apr 20, 2020
1.11.3
Feb 24, 2020
1.11.2
Feb 21, 2020
1.11.1
Feb 21, 2020
1.11.0
Feb 20, 2020
1.10.10
Dec 30, 2019
1.10.9
Dec 11, 2019
1.10.8
Oct 31, 2019
1.10.7
Oct 27, 2019
1.10.6
Sep 28, 2019
1.10.5
Sep 27, 2019
1.10.4
Sep 21, 2019
1.10.3
Sep 12, 2019
1.10.2
Sep 12, 2019
1.10.1
Sep 09, 2019
1.10.0
Sep 08, 2019
1.9.0
Jul 06, 2019
1.8.0
May 30, 2019
1.7.7
May 06, 2019
1.7.6
May 05, 2019
1.7.5
May 05, 2019
1.7.4
May 02, 2019
1.7.3
May 01, 2019
1.7.2
Apr 29, 2019
1.7.1
Apr 24, 2019
1.7
Apr 22, 2019
1.6.2
Mar 04, 2019
1.6.1.post1
Feb 28, 2019
1.6.1
Feb 28, 2019
1.6
Feb 27, 2019
1.5.5
Feb 02, 2019
1.5.4
Jan 15, 2019
1.5.3
Jan 14, 2019
1.5.2
Jan 05, 2019
1.5.1
Jan 03, 2019
1.5
Dec 25, 2018
1.4.3
Dec 04, 2018
1.4.2
Nov 24, 2018
1.4.1
Nov 03, 2018
1.4
Nov 03, 2018
1.3
Sep 22, 2018
1.2
Aug 14, 2018
1.1.1
Jul 23, 2018
1.1
Jul 21, 2018
1.0.4
Jul 09, 2018
1.0.3
Jul 04, 2018
1.0.2
Jun 28, 2018
1.0.1
Jun 27, 2018
1.0.post2
Jun 27, 2018
1.0rc1
Jun 24, 2018
0.19.1.6
Jun 13, 2018
0.19.1.5
Jun 12, 2018
0.19.1.4
Jun 04, 2018
0.19.1.3
Jun 03, 2018
0.19.1.2
Jun 03, 2018
0.19.1.1
Jun 03, 2018
0.19.1
Jun 03, 2018
0.19.0.1
May 20, 2018
0.19
May 07, 2018
0.18.3
Apr 15, 2018
0.18.2.3
Mar 30, 2018
0.18.2.2
Mar 28, 2018
0.18.2.1
Mar 28, 2018
0.18.2
Mar 27, 2018
0.18.1.1
Mar 21, 2018
0.18.1
Mar 17, 2018
0.18.0.3
Mar 11, 2018
0.18.0.2
Mar 08, 2018
0.18.0.1
Mar 07, 2018
0.18
Mar 04, 2018
0.17.4.5
Feb 27, 2018
0.17.4.4
Feb 27, 2018
0.17.4.3
Feb 26, 2018
0.17.4.2
Feb 26, 2018
0.17.4.1
Feb 24, 2018
0.17.4
Feb 24, 2018
0.17.3
Feb 18, 2018
0.17.2.4
Feb 18, 2018
0.17.2.3
Feb 16, 2018
0.17.2.2
Feb 16, 2018
0.17.2.1
Feb 16, 2018
0.17.2
Feb 15, 2018
0.17.1.2
Feb 13, 2018
0.17.1.1
Feb 11, 2018
0.17.1
Feb 09, 2018
0.17
Feb 03, 2018
0.16.2.3
Jan 26, 2018
0.16.2.2
Jan 20, 2018
0.16.2.1
Jan 19, 2018
0.16.2
Jan 19, 2018
0.16.1.4
Jan 17, 2018
0.16.1.3
Jan 15, 2018
0.16.1.2
Jan 14, 2018
0.16.1.1
Jan 13, 2018
0.16.1
Jan 11, 2018
0.16.0.11
Jan 08, 2018
0.16.0.10
Jan 08, 2018
0.16.0.9
Jan 06, 2018
0.16.0.8
Jan 06, 2018
0.16.0.7
Jan 06, 2018
0.16.0.6
Jan 05, 2018
0.16.0.5
Jan 04, 2018
0.16.0.4
Dec 29, 2017
0.16.0.3
Dec 28, 2017
0.16.0.2
Dec 28, 2017
0.16.0.1
Dec 28, 2017
0.16
Dec 28, 2017
0.15.5.7
Nov 28, 2017
0.15.5.6
Nov 28, 2017
0.15.5.5
Nov 28, 2017
0.15.5.4
Nov 28, 2017
0.15.5.3
Nov 26, 2017
0.15.5.2
Nov 25, 2017
0.15.5.1
Nov 20, 2017
0.15.5
Nov 16, 2017
0.15.4.3
Nov 11, 2017
0.15.4.2
Nov 07, 2017
0.15.4.1
Nov 06, 2017
0.15.4
Nov 04, 2017
0.15.3.2
Oct 24, 2017
0.15.3.1
Oct 22, 2017
0.15.3
Oct 20, 2017
0.15.2.5
Oct 20, 2017
0.15.2.4
Oct 19, 2017
0.15.2.3
Oct 18, 2017
0.15.2.2
Oct 18, 2017
0.15.2.1
Oct 16, 2017
0.15.2
Oct 14, 2017
0.15.1.5
Oct 09, 2017
0.15.1.4
Oct 09, 2017
0.15.1.3
Oct 08, 2017
0.15.1.2
Oct 07, 2017
0.15.1.1
Oct 06, 2017
0.15.1
Oct 05, 2017
0.15.0.4
Oct 02, 2017
0.15.0.3
Oct 01, 2017
0.15.0.2
Oct 01, 2017
0.15.0.1
Oct 01, 2017
0.15
Oct 01, 2017
0.14.2
Sep 29, 2017
0.14
Sep 27, 2017
0.13.6
Sep 23, 2017
0.13.5.1
Sep 22, 2017
0.13.5
Sep 22, 2017
0.13.4
Sep 18, 2017
0.13.3
Sep 14, 2017
0.13.2.2
Sep 08, 2017
0.13.2.1
Sep 08, 2017
0.13.2
Sep 08, 2017
0.13.1
Sep 04, 2017
0.13
Sep 04, 2017
0.12.2
Aug 28, 2017
0.12.1
Aug 24, 2017
0.12
Aug 23, 2017
0.11.5
Jul 11, 2017
0.11.4
Jul 10, 2017
0.11.3
Jul 04, 2017
0.11.2.1
Jul 04, 2017
0.11.1
Jun 24, 2017
0.11
Jun 16, 2017
0.10.1
Jun 09, 2017
0.10
Jun 03, 2017
0.9.1
May 23, 2017
0.9
May 19, 2017
0.8
Apr 14, 2017
0.7.1
Feb 19, 2017
0.7.0.1
Jan 31, 2017
0.6
Nov 13, 2016
0.5.0.2
Sep 18, 2016
0.6.linux
Nov 13, 2016