2022-04-26 00:02:51 +08:00
|
|
|
package models
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// PollAnswer https://core.telegram.org/bots/api#pollanswer
|
2022-04-26 00:02:51 +08:00
|
|
|
type PollAnswer struct {
|
|
|
|
PollID string `json:"poll_id"`
|
2023-08-24 16:29:23 +08:00
|
|
|
VoterChat *Chat `json:"voter_chat,omitempty"`
|
2022-04-26 00:02:51 +08:00
|
|
|
User *User `json:"user"`
|
|
|
|
OptionIDs []int `json:"option_ids,omitempty"`
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:07:43 +08:00
|
|
|
// InputPollOption https://core.telegram.org/bots/api#inputpolloption
|
|
|
|
type InputPollOption struct {
|
|
|
|
Text string `json:"text"`
|
|
|
|
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
|
|
|
|
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
|
|
|
}
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// PollOption https://core.telegram.org/bots/api#polloption
|
2022-04-26 00:02:51 +08:00
|
|
|
type PollOption struct {
|
2024-05-20 17:07:43 +08:00
|
|
|
Text string `json:"text"`
|
|
|
|
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
|
|
|
VoterCount int `json:"voter_count"`
|
2022-04-26 00:02:51 +08:00
|
|
|
}
|
|
|
|
|
2022-04-29 17:21:42 +08:00
|
|
|
// Poll https://core.telegram.org/bots/api#poll
|
2022-04-26 00:02:51 +08:00
|
|
|
type Poll struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
Question string `json:"question"`
|
2024-05-20 17:07:43 +08:00
|
|
|
QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
|
2022-04-26 00:02:51 +08:00
|
|
|
Options []PollOption `json:"options"`
|
|
|
|
TotalVoterCount int `json:"total_voter_count"`
|
|
|
|
IsClosed bool `json:"is_closed"`
|
|
|
|
IsAnonymous bool `json:"is_anonymous"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
AllowsMultipleAnswers bool `json:"allows_multiple_answers"`
|
|
|
|
CorrectOptionID int `json:"correct_option_id,omitempty"`
|
|
|
|
Explanation string `json:"explanation,omitempty"`
|
|
|
|
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
|
|
|
|
OpenPeriod int `json:"open_period,omitempty"`
|
|
|
|
CloseDate int `json:"close_date,omitempty"`
|
|
|
|
}
|