masterpoll-go-sdk: github.com/ErikPelli/masterpoll-go-sdk Index | Files | Directories

package masterpoll_go_sdk

import "github.com/ErikPelli/masterpoll-go-sdk"

Package to manage MasterPoll API using polls' package types.

Index

Package Files

masterpoll.go poll.go status.go

func AddPollVote Uses

func AddPollVote(poll *polls.Poll, value interface{}) error

AddPollVote adds your vote to a poll. value param by poll type: vote, doodle, limited doodle, quiz and board -> string rating -> int between 1 and 10 participation -> nil (It isn't required)

func ClosePoll Uses

func ClosePoll(poll *polls.Poll) error

ClosePoll closes a opened poll (people will no longer be able to vote).

func DeletePoll Uses

func DeletePoll(poll *polls.Poll) error

DeletePoll deletes the poll definitively (this action is irreversible).

func EditPoll Uses

func EditPoll(poll *polls.Poll, privacy bool, settings *polls.Settings) error

EditPoll edits an existent poll.

func EditPollVote Uses

func EditPollVote(poll *polls.Poll, value interface{}) error

EditPollVote edits your vote in a poll. value param by poll type: vote, quiz and board -> string rating -> int between 1 and 10 participation -> bool (true or false) doodle and limited doodle -> not supported

func GetGraph Uses

func GetGraph(poll *polls.Poll, dark, bar bool) (string, error)

Function to get an URL with the graph of the poll. dark: true -> dark, false -> light. bar: true -> bar, false -> pie.

func GetStatus Uses

func GetStatus() bool

GetStatus() returns API status (true -> ON, false -> OFF)

func OpenPoll Uses

func OpenPoll(poll *polls.Poll) error

OpenPoll opens a closed poll.

func RemovePollVote Uses

func RemovePollVote(poll *polls.Poll, choice string) error

RemoveVote removes your vote from a poll. Choice must contain the vote to remove as string only if the poll type is doodle, limited doodle or quiz (For the others you have to use "").

type MasterPoll Uses

type MasterPoll string

func MasterPollNew Uses

func MasterPollNew(APIKey string) *MasterPoll

Create a new MasterPoll with an API key.

func (*MasterPoll) CreatePoll Uses

func (MPoll *MasterPoll) CreatePoll(pollSend interface{}) (int, error)

Create a new poll with a PollSend interface object and return poll_id as int.

func (*MasterPoll) GetActivePolls Uses

func (MPoll *MasterPoll) GetActivePolls() ([]*polls.Poll, error)

GetActivePolls returns all your polls currently active in MasterPoll database.

func (*MasterPoll) GetAllPolls Uses

func (MPoll *MasterPoll) GetAllPolls() ([]*polls.Poll, error)

GetActivePolls returns all your polls in MasterPoll database.

func (*MasterPoll) GetMe Uses

func (MPoll *MasterPoll) GetMe() ([]string, error)

GetMe() returns your personal information saved in bot database as a []string. 0 -> first_name, 1 -> last_name, 2 -> username, 3 -> language.

func (*MasterPoll) GetPoll Uses

func (MPoll *MasterPoll) GetPoll(pollId int) (*polls.Poll, error)

GetPoll gets an existent poll from its id.

func (*MasterPoll) GetSubscribers Uses

func (MPoll *MasterPoll) GetSubscribers() (int, error)

GetSubscribers() returns bot subscribers number

func (*MasterPoll) SetAPI Uses

func (MPoll *MasterPoll) SetAPI(APIKey string)

Change API key of MasterPoll.

Directories

PathSynopsis
errorsPackage to manage errors produced by other packages.
internal/requests
internal/requests/JsonType
pollsPackage polls provides types to manage polls and some functions to create or manage them.

Package masterpoll_go_sdk imports 3 packages (graph). Updated 2020-05-16. Refresh now. Tools for package owners.