All Implemented Interfaces:
Validable

public class RestrictChatMember extends BotApiMethodBoolean
Version:
3.1 Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user. Returns True on success.
Author:
Ruben Bermudez
  • Field Details

  • Constructor Details

    • RestrictChatMember

      public RestrictChatMember()
  • 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