Documentation ¶
Overview ¶
Package to manage MasterPoll API using polls' package types.
Index ¶
- func AddPollVote(poll *polls.Poll, value interface{}) error
- func ClosePoll(poll *polls.Poll) error
- func DeletePoll(poll *polls.Poll) error
- func EditPoll(poll *polls.Poll, privacy bool, settings *polls.Settings) error
- func EditPollVote(poll *polls.Poll, value interface{}) error
- func GetGraph(poll *polls.Poll, dark, bar bool) (string, error)
- func GetStatus() bool
- func OpenPoll(poll *polls.Poll) error
- func RemovePollVote(poll *polls.Poll, choice string) error
- type MasterPoll
- func (MPoll *MasterPoll) CreatePoll(pollSend interface{}) (int, error)
- func (MPoll *MasterPoll) GetActivePolls() ([]*polls.Poll, error)
- func (MPoll *MasterPoll) GetAllPolls() ([]*polls.Poll, error)
- func (MPoll *MasterPoll) GetMe() ([]string, error)
- func (MPoll *MasterPoll) GetPoll(pollId int) (*polls.Poll, error)
- func (MPoll *MasterPoll) GetSubscribers() (int, error)
- func (MPoll *MasterPoll) SetAPI(APIKey string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPollVote ¶
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 DeletePoll ¶
DeletePoll deletes the poll definitively (this action is irreversible).
func EditPollVote ¶
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
Types ¶
type MasterPoll ¶
type MasterPoll string
func MasterPollNew ¶
func MasterPollNew(APIKey string) *MasterPoll
Create a new MasterPoll with an API key.
func (*MasterPoll) CreatePoll ¶
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 ¶
func (MPoll *MasterPoll) GetActivePolls() ([]*polls.Poll, error)
GetActivePolls returns all your polls currently active in MasterPoll database.
func (*MasterPoll) GetAllPolls ¶
func (MPoll *MasterPoll) GetAllPolls() ([]*polls.Poll, error)
GetActivePolls returns all your polls in MasterPoll database.
func (*MasterPoll) GetMe ¶
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 ¶
func (MPoll *MasterPoll) GetPoll(pollId int) (*polls.Poll, error)
GetPoll gets an existent poll from its id.
func (*MasterPoll) GetSubscribers ¶
func (MPoll *MasterPoll) GetSubscribers() (int, error)
GetSubscribers() returns bot subscribers number
func (*MasterPoll) SetAPI ¶
func (MPoll *MasterPoll) SetAPI(APIKey string)
Change API key of MasterPoll.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package to manage errors produced by other packages.
|
Package to manage errors produced by other packages. |
internal
|
|
Package polls provides types to manage polls and some functions to create or manage them.
|
Package polls provides types to manage polls and some functions to create or manage them. |