the9titans
the9titans

Reputation: 1

Is there a way for me to join a private channel that requires admin access on Telegram using Telethon?

import asyncio
from telethon import TelegramClient, functions

name = "random_name"
api_id = 12345678
api_hash = "random_api_hash"

invite_link = "random_invite_link"

async def main():
    async with TelegramClient(name, api_id, api_hash) as client:
        result = await client(functions.messages.ImportChatInviteRequest(invite_link))
        print(result.stringify())

        group_info = await client(functions.groups.GetFullChatRequest(result.chat_id))
        linked_chat_id = group_info.full_chat.linked_chat_id

        if linked_chat_id:
            join_result = await client(functions.channels.JoinChannelRequest(linked_chat_id))
            print(join_result.stringify())

asyncio.run(main())

I ran this code and only got an Invite Request Sent Error: You have successfully requested to join this chat or channel (caused by Import Chat Invite Request).

This means that instead of directly joining, my request has been sent for approval and I now have to wait for an admin to manually accept it. I want to find a way to bypass this approval process and join the channel.

I want to know if there's a workaround to join the channel without needing the admin accept / without needing to request. I managed to cache the chat id and I do have the invite link but how do I join the channel without needing the admin accept?

Upvotes: 0

Views: 38

Answers (1)

Andrii Lytvynenko
Andrii Lytvynenko

Reputation: 1

Unfortunately, not(if the channel is private). All this "confirming" process takes place on Telegram servers and is not possible without personal admin's approval or privileged bot, who has rights to manage this link. Telegram is secure in this way.

Upvotes: 0

Related Questions