1
0
Fork 0

💥 Changed coordinates type from float32 to float64

This commit is contained in:
Maxim Lebedev 2020-11-30 18:56:49 +05:00
parent f3e092aebd
commit 8948e68c22
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
4 changed files with 31 additions and 31 deletions

View File

@ -392,16 +392,16 @@ type (
ID string `json:"id"`
// Location latitude in degrees
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Location longitude in degrees
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// Location title
Title string `json:"title"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"`
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Period in seconds for which the location can be updated, should be between 60 and 86400.
LivePeriod int `json:"live_period,omitempty"`
@ -440,10 +440,10 @@ type (
ID string `json:"id"`
// Latitude of the venue location in degrees
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Longitude of the venue location in degrees
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// Title of the venue
Title string `json:"title"`
@ -817,13 +817,13 @@ type (
// inline query.
InputLocationMessageContent struct {
// Latitude of the location in degrees
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Longitude of the location in degrees
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"`
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Period in seconds for which the location can be updated, should be between 60 and 86400.
LivePeriod int `json:"live_period,omitempty"`
@ -841,10 +841,10 @@ type (
// query.
InputVenueMessageContent struct {
// Latitude of the location in degrees
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Longitude of the location in degrees
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// Name of the venue
Title string `json:"title"`
@ -1168,7 +1168,7 @@ func NewInlineQueryResultGif(id, gif, thumb string) InlineQueryResultGif {
func (InlineQueryResultGif) IsCached() bool { return false }
func NewInlineQueryResultLocation(id, title string, lat, long float32) InlineQueryResultLocation {
func NewInlineQueryResultLocation(id, title string, lat, long float64) InlineQueryResultLocation {
return InlineQueryResultLocation{
Type: TypeLocation,
ID: id,
@ -1202,7 +1202,7 @@ func NewInlineQueryResultPhoto(id, photo, thumb string) InlineQueryResultPhoto {
func (InlineQueryResultPhoto) IsCached() bool { return false }
func NewInlineQueryResultVenue(id, title, addr string, lat, long float32) InlineQueryResultVenue {
func NewInlineQueryResultVenue(id, title, addr string, lat, long float64) InlineQueryResultVenue {
return InlineQueryResultVenue{
Type: TypeVenue,
ID: id,

View File

@ -362,13 +362,13 @@ type (
ChatID ChatID `json:"chat_id"`
// Latitude of the location
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Longitude of the location
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"`
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Period in seconds for which the location will be updated (see Live Locations), should be between 60
// and 86400.
@ -407,13 +407,13 @@ type (
InlineMessageID string `json:"inline_message_id,omitempty"`
// Latitude of new location
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Longitude of new location
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"`
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
Heading int `json:"heading,omitempty"`
@ -445,10 +445,10 @@ type (
ChatID ChatID `json:"chat_id"`
// Latitude of the venue
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// Longitude of the venue
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// Name of the venue
Title string `json:"title"`
@ -1346,7 +1346,7 @@ func (b Bot) SendMediaGroup(p SendMediaGroup) ([]*Message, error) {
return result, nil
}
func NewLocation(chatID ChatID, latitude, longitude float32) SendLocation {
func NewLocation(chatID ChatID, latitude, longitude float64) SendLocation {
return SendLocation{
ChatID: chatID,
Latitude: latitude,
@ -1369,7 +1369,7 @@ func (b Bot) SendLocation(p SendLocation) (*Message, error) {
return result, nil
}
func NewLiveLocation(latitude, longitude float32) EditMessageLiveLocation {
func NewLiveLocation(latitude, longitude float64) EditMessageLiveLocation {
return EditMessageLiveLocation{
Latitude: latitude,
Longitude: longitude,
@ -1406,11 +1406,11 @@ func (b Bot) StopMessageLiveLocation(p StopMessageLiveLocation) (*Message, error
return result, nil
}
func NewVenue(chatID ChatID, latitude, longitude float32, title, address string) SendVenue {
func NewVenue(chatID ChatID, lat, long float64, title, address string) SendVenue {
return SendVenue{
ChatID: chatID,
Latitude: latitude,
Longitude: longitude,
Latitude: lat,
Longitude: long,
Title: title,
Address: address,
}

View File

@ -66,13 +66,13 @@ type (
Point string `json:"point"`
// Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
XShift float32 `json:"x_shift"`
XShift float64 `json:"x_shift"`
// Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
YShift float32 `json:"y_shift"`
YShift float64 `json:"y_shift"`
// Mask scaling coefficient. For example, 2.0 means double size.
Scale float32 `json:"scale"`
Scale float64 `json:"scale"`
}
// SendStickerParameters represents data for SetSticker method.

View File

@ -480,13 +480,13 @@ type (
// Location represents a point on the map.
Location struct {
// Longitude as defined by sender
Longitude float32 `json:"longitude"`
Longitude float64 `json:"longitude"`
// Latitude as defined by sender
Latitude float32 `json:"latitude"`
Latitude float64 `json:"latitude"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"`
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Time relative to the message sending date, during which the location can be updated, in seconds.
// For active live locations only.