I am using the Telethon library for python. How can I change Telegram channel name? Couldn't find this in documentation.
For now, you have to use Telethon's raw API. If we search for "edit title" we will find channels.editTitle
. Such page has the following automatically-generated example:
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.channels.EditTitleRequest(
channel='username',
title='My awesome title'
))
print(result.stringify())
If you meant the username, channels.updateUsername
is the right one:
client(functions.channels.UpdateUsernameRequest(
channel='old username',
username='new username'
))
You can of course pass the channel ID or invite link instead of the username if it doesn't have one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With