• Ban a user/channel from a legacy group, a supergroup or a channel. They will not be able to re-join the group on their own, manual administrator's action will be required.

    When banning a channel, the user won't be able to use any of their channels to post until the ban is lifted.

    Parameters

    • client: ITelegramClient
    • params: {
          chatId: InputPeerLike;
          participantId: InputPeerLike;
          shouldDispatch?: true;
          untilDate?: number | Date;
      }
      • chatId: InputPeerLike

        Chat ID

      • participantId: InputPeerLike

        ID of the user/channel to ban

      • OptionalshouldDispatch?: true

        Whether to dispatch the returned service message (if any) to the client's update handler.

      • OptionaluntilDate?: number | Date

    Returns Promise<Message | null>

    Service message about removed user, if one was generated.