chore(examples): use api.Ptr for optional pointer fields

Replace the throwaway-local-var-then-take-address pattern with
api.Ptr in the polls and moderation examples. Net effect: 14 lines
gone, the pointer wrangling no longer steals visual focus from the
actual API call.
This commit is contained in:
2026-05-09 18:20:00 +01:00
parent f3fbef64ca
commit 1ff26006f7
2 changed files with 12 additions and 16 deletions
+1 -2
View File
@@ -94,12 +94,11 @@ func main() {
})
return nil
}
isAnon := false
msg, err := api.SendPoll(c.Ctx, c.Bot, &api.SendPollParams{
ChatID: api.ChatIDFromInt(m.Chat.ID),
Question: question,
Options: pollOptions,
IsAnonymous: &isAnon,
IsAnonymous: api.Ptr(false),
})
if err != nil {
return err