mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-06-30 20:45:31 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user