Add support for Polls and other API 4.2 updates.
This commit is contained in:
parent
fa40708257
commit
db88019230
5 changed files with 127 additions and 1 deletions
21
helpers.go
21
helpers.go
|
@ -814,3 +814,24 @@ func NewDeleteChatPhoto(chatID int64, photo interface{}) DeleteChatPhotoConfig {
|
|||
ChatID: chatID,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPoll allows you to create a new poll.
|
||||
func NewPoll(chatID int64, question string, options ...string) SendPollConfig {
|
||||
return SendPollConfig{
|
||||
BaseChat: BaseChat{
|
||||
ChatID: chatID,
|
||||
},
|
||||
Question: question,
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
|
||||
// NewStopPoll allows you to stop a poll.
|
||||
func NewStopPoll(chatID int64, messageID int) StopPollConfig {
|
||||
return StopPollConfig{
|
||||
BaseEdit{
|
||||
ChatID: chatID,
|
||||
MessageID: messageID,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue