All Implemented Interfaces:
Validable

public class BanChatMember extends BotApiMethodBoolean
Version:
5.3 Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the group for this to work. Returns True on success.
Author:
Ruben Bermudez
  • Field Details

  • Constructor Details

    • BanChatMember

      public BanChatMember()
  • Method Details

    • setChatId

      public void setChatId(@NonNull @NonNull Long chatId)
    • setUntilDateInstant

      public void setUntilDateInstant(Instant instant)
    • setUntilDateDateTime

      public void setUntilDateDateTime(ZonedDateTime date)
    • forTimePeriodDuration

      public void forTimePeriodDuration(Duration duration)
    • getMethod

      public String getMethod()
      Description copied from class: BotApiMethod
      Getter for method path (that is the same as method name)
      Specified by:
      getMethod in class BotApiMethod<Boolean>
      Returns:
      Method path
    • validate

      public void validate() throws TelegramApiValidationException
      Description copied from interface: Validable
      Validates that mandatory fields are filled and optional objects
      Throws:
      TelegramApiValidationException - If any mandatory field is empty