Content-Length: 275950 | pFad | http://github.com/nicklaw5/helix/blob/main/docs/polls_docs.md

30 helix/docs/polls_docs.md at main · nicklaw5/helix · GitHub
Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 1.27 KB

polls_docs.md

File metadata and controls

75 lines (60 loc) · 1.27 KB

Polls Documentation

Get Polls

This is an example of how to get polls.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.GetPolls(&helix.PollsParams{
    BroadcasterID: "145328278",
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

Create Poll

This is an example of how to create a poll.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.CreatePoll(&helix.CreatePollParams{
    BroadcasterID: "145328278",
    Title: "Test",
    Choices: []helix.PollChoiceParam{
        helix.PollChoiceParam{ Title: "choice 1" },
        helix.PollChoiceParam{ Title: "choice 2" },
    },
    Duration: 30,
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

End Poll

This is an example of how to end a poll.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.EndPoll(&helix.EndPollParams{
    BroadcasterID: "145328278",
    ID: "25b14b42-d4d8-4756-86ce-842bf76f82a0",
    Status: "TERMINATED",
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/nicklaw5/helix/blob/main/docs/polls_docs.md

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy