Added `editMessageLiveLocation` and `stopMessageLiveLocation` methods

bot-api-6.1
pr0head 2017-10-14 01:05:24 +03:00
parent 7031d820be
commit 5cbecde819
2 changed files with 54 additions and 12 deletions

View File

@ -597,6 +597,51 @@ func (config LocationConfig) method() string {
return "sendLocation" return "sendLocation"
} }
// LocationConfig contains information about a SendLocation request.
type EditMessageLiveLocationConfig struct {
BaseEdit
Latitude float64 // required
Longitude float64 // required
}
// values returns a url.Values representation of EditMessageLiveLocationConfig.
func (config EditMessageLiveLocationConfig) values() (url.Values, error) {
v, err := config.BaseEdit.values()
if err != nil {
return v, err
}
v.Add("latitude", strconv.FormatFloat(config.Latitude, 'f', 6, 64))
v.Add("longitude", strconv.FormatFloat(config.Longitude, 'f', 6, 64))
return v, nil
}
// method returns Telegram API method name for edit message Live Location.
func (config EditMessageLiveLocationConfig) method() string {
return "editMessageLiveLocation"
}
// LocationConfig contains information about a StopMessageLiveLocation request.
type StopMessageLiveLocationConfig struct {
BaseEdit
}
// values returns a url.Values representation of StopMessageLiveLocationConfig.
func (config StopMessageLiveLocationConfig) values() (url.Values, error) {
v, err := config.BaseEdit.values()
if err != nil {
return v, err
}
return v, nil
}
// method returns Telegram API method name for stop message Live Location.
func (config StopMessageLiveLocationConfig) method() string {
return "stopMessageLiveLocation"
}
// VenueConfig contains information about a SendVenue request. // VenueConfig contains information about a SendVenue request.
type VenueConfig struct { type VenueConfig struct {
BaseChat BaseChat

View File

@ -333,7 +333,6 @@ type Contact struct {
type Location struct { type Location struct {
Longitude float64 `json:"longitude"` Longitude float64 `json:"longitude"`
Latitude float64 `json:"latitude"` Latitude float64 `json:"latitude"`
LivePeriod int `json:"live_period"`
} }
// Venue contains information about a venue, including its Location. // Venue contains information about a venue, including its Location.
@ -644,7 +643,6 @@ type InlineQueryResultLocation struct {
ID string `json:"id"` // required ID string `json:"id"` // required
Latitude float64 `json:"latitude"` // required Latitude float64 `json:"latitude"` // required
Longitude float64 `json:"longitude"` // required Longitude float64 `json:"longitude"` // required
LivePeriod int `json:"live_period"` // optional
Title string `json:"title"` // required Title string `json:"title"` // required
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
InputMessageContent interface{} `json:"input_message_content,omitempty"` InputMessageContent interface{} `json:"input_message_content,omitempty"`
@ -683,7 +681,6 @@ type InputTextMessageContent struct {
type InputLocationMessageContent struct { type InputLocationMessageContent struct {
Latitude float64 `json:"latitude"` Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"` Longitude float64 `json:"longitude"`
LivePeriod int `json:"live_period"`
} }
// InputVenueMessageContent contains a venue for displaying // InputVenueMessageContent contains a venue for displaying