2019-04-15 12:05:03 +00:00
|
|
|
package telegram
|
|
|
|
|
|
|
|
type StopPollConfig struct {
|
|
|
|
// Unique identifier for the target chat. A native poll can't be sent to a private chat.
|
|
|
|
ChatID int64 `json:"chat_id"`
|
|
|
|
|
|
|
|
// Identifier of the original message with the poll
|
|
|
|
MessageID int `json:"message_id"`
|
|
|
|
|
|
|
|
// A JSON-serialized object for a new message inline keyboard.
|
|
|
|
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *Bot) StopPoll(params StopPollConfig) (*Poll, error) {
|
2019-07-24 09:34:55 +00:00
|
|
|
dst, err := parser.Marshal(params)
|
2019-04-15 12:05:03 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
resp, err := b.request(dst, MethodStopPoll)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
var poll Poll
|
2019-07-24 09:34:55 +00:00
|
|
|
err = parser.Unmarshal(resp.Result, &poll)
|
2019-04-15 12:05:03 +00:00
|
|
|
return &poll, err
|
|
|
|
}
|