Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

Add telegram bot to channel/group using telegram api methods #571

Description

@ParthShah0411

Hello, I want to add telegram bot into channel/group whenever requested. I've tried almost all the different methods using which I can add user to the chat/group/channel but still not able to figure it out. hoping to get response here.

The function method I mostly got after looking in google was InviteToChannel but not sure how to pass bot id so that it doesn't give me error RPCError: 400: USER_BOT (caused by channels.InviteToChannel)

Code :

const addBott = await client.invoke(
new Api.channels.InviteToChannel({
channel: -1001923158756,
users: ["test_bot"],
})
);

            &

const addBot = await client.invoke(
new Api.channels.InviteToChannel({
channel: -1001923168756,
users: [new Api.InputUser({ user_id: BigInt("6325799628") })],
})
);

PS: I've modified the values. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions