gotd: update to layer 224

This commit is contained in:
Tulir Asokan
2026-04-01 21:08:49 +03:00
parent 7630340ffc
commit 770b3b8d8c
77 changed files with 10606 additions and 703 deletions
+4 -4
View File
@@ -21,7 +21,7 @@ type pollAnswerBuilder struct {
type PollAnswerOption func(p *pollAnswerBuilder)
// RawPollAnswer creates new raw poll answer option.
func RawPollAnswer(poll tg.PollAnswer) PollAnswerOption {
func RawPollAnswer(poll *tg.PollAnswer) PollAnswerOption {
return func(p *pollAnswerBuilder) {
p.input.Poll.Answers = append(p.input.Poll.Answers, poll)
}
@@ -31,7 +31,7 @@ func RawPollAnswer(poll tg.PollAnswer) PollAnswerOption {
func PollAnswer(text string, entities ...tg.MessageEntityClass) PollAnswerOption {
return func(p *pollAnswerBuilder) {
i := len(p.input.Poll.Answers)
p.input.Poll.Answers = append(p.input.Poll.Answers, tg.PollAnswer{
p.input.Poll.Answers = append(p.input.Poll.Answers, &tg.PollAnswer{
Text: tg.TextWithEntities{Text: text, Entities: entities},
Option: []byte(strconv.Itoa(i)),
})
@@ -44,11 +44,11 @@ func CorrectPollAnswer(text string, entities ...tg.MessageEntityClass) PollAnswe
p.input.Poll.Quiz = true
i := len(p.input.Poll.Answers)
option := []byte(strconv.Itoa(i))
p.input.Poll.Answers = append(p.input.Poll.Answers, tg.PollAnswer{
p.input.Poll.Answers = append(p.input.Poll.Answers, &tg.PollAnswer{
Text: tg.TextWithEntities{Text: text, Entities: entities},
Option: option,
})
p.input.CorrectAnswers = append(p.input.CorrectAnswers, option)
p.input.CorrectAnswers = append(p.input.CorrectAnswers, i)
}
}