Add user to channel automatically when user asks

前端 未结 3 1188
刺人心
刺人心 2021-02-14 05:49

I want to make a very simple project that does this:

An user (let\'s call him John) opens a Telegram chat with my bot, and inputs this:

User John: /join channel1

3条回答
  •  没有蜡笔的小新
    2021-02-14 06:19

    You can invite other users to your channel using:

    channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates;
    

    You can invite several uses at a time, via a list (Vector) of InputUser.

    This seems consistent with Telegram Desktop and the mobile clients, which allows you to select multiple contacts and add them to your group.

    InputUser is of the form:

    inputUser#d8292816 user_id:int access_hash:long = InputUser;
    

提交回复
热议问题