Class SendLocation


public class SendLocation extends AbstractBaseRequest<SendLocation,Message>
SendLocation class. Returns sent Message on success.
Since:
3 March 2025
  • Constructor Details

    • SendLocation

      public SendLocation(Object chatId, double latitude, double longitude, Api api)
      Required
      Parameters:
      chatId - chat id
      latitude - latitude
      longitude - longitude
      api - api
  • Method Details

    • horizontalAccuracy

      public SendLocation horizontalAccuracy(double horizontalAccuracy)
      Optional
      Parameters:
      horizontalAccuracy - The radius of uncertainty for the location, measured in meters; 0-1500
      Returns:
      SendLocation
    • livePeriod

      public SendLocation livePeriod(int livePeriod)
      Optional
      Parameters:
      livePeriod - Period in seconds during which the location will be updated (should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
      Returns:
      SendLocation
      See Also:
    • heading

      public SendLocation heading(int heading)
      Optional
      Parameters:
      heading - For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
      Returns:
      SendLocation
    • proximityAlertRadius

      public SendLocation proximityAlertRadius(int proximityAlertRadius)
      Optional
      Parameters:
      proximityAlertRadius - For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
      Returns:
      SendLocation
    • disableNotification

      public SendLocation disableNotification(boolean disable_notification)
      Optional
      Parameters:
      disable_notification - Sends the message silently. Users will receive a notification with no sound.
      Returns:
      SendLocation
    • protectContent

      public SendLocation protectContent(boolean protectContent)
      Optional
      Parameters:
      protectContent - Protects the contents of the sent message from forwarding and saving
      Returns:
      SendLocation
    • replyParameters

      public SendLocation replyParameters(ReplyParameters replyParameters)
      Optional
      Parameters:
      replyParameters - Description of the message to reply to
      Returns:
      SendLocation
    • replyMarkup

      public SendLocation replyMarkup(Markup replyMarkup)
      Optional
      Parameters:
      replyMarkup - Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
      Returns:
      SendLocation
    • businessConnectionId

      public SendLocation businessConnectionId(String businessConnectionId)
      Optional
      Parameters:
      businessConnectionId - Unique identifier of the business connection on behalf of which the message will be sent
      Returns:
      SendLocation
    • messageEffectId

      public SendLocation messageEffectId(String messageEffectId)
      Optional
      Parameters:
      messageEffectId - Unique identifier of the message effect to be added to the message; for private chats only
      Returns:
      SendLocation
    • directMessagesTopicId

      public SendLocation directMessagesTopicId(int directMessagesTopicId)
      Optional
      Parameters:
      directMessagesTopicId - Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
      Returns:
      SendLocation
    • suggestedPostParameters

      public SendLocation suggestedPostParameters(SuggestedPostParameters suggestedPostParameters)
      Optional
      Parameters:
      suggestedPostParameters - A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
      Returns:
      SendLocation