How To Get A Telegram Private Channel Id With Telethon
Hi can't figure out how to solve this problem, so any help will be really appreciated. I'm subscribed to a private channel. This channel has no username and I don't have the invite
Solution 1:
if you have access to the channel, then it's shown in your chat list.
You have to loop through your chats checking their titles and then store the desired chat in a variable:
my_private_channel_id = None
my_private_channel = Noneasyncfor dialog in tg.client.iter_dialogs():
if dialog.name == "private chat name":
my_private_channel = dialog
my_private_channel_id = dialog.idbreakif my_private_channel isNone:
print("chat not found")
else:
print("chat id is", my_private_channel_id)
Than you can filter messages sent to my_private_channel.
Solution 2:
You can't join a private channel without the invite link, nor can you get any information about it. It's private, as the name implies.
Post a Comment for "How To Get A Telegram Private Channel Id With Telethon"