Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSessionInChannel = errors.New("a trivia session already exists in this channel")
View Source
var TriviaDuration = time.Second * 30
Functions ¶
func RegisterPlugin ¶
func RegisterPlugin()
Types ¶
type Plugin ¶
type Plugin struct{}
func (*Plugin) AddCommands ¶
func (p *Plugin) AddCommands()
func (*Plugin) PluginInfo ¶
func (p *Plugin) PluginInfo() *common.PluginInfo
type TriviaQuestion ¶
type TriviaQuestion struct { Question string `json:"question"` Answer string `json:"correct_answer"` Category string `json:"category"` Type string `json:"type"` Options []string `json:"incorrect_answers"` }
func FetchQuestions ¶
func FetchQuestions(amount int) ([]*TriviaQuestion, error)
func (*TriviaQuestion) Decode ¶
func (q *TriviaQuestion) Decode()
func (*TriviaQuestion) RandomizeOptionOrder ¶
func (q *TriviaQuestion) RandomizeOptionOrder()
RandomizeOptionOrder randomizes the option order and returns the result this also adds the answer to the list of options
type TriviaResponse ¶
type TriviaResponse struct { Code int `json:"response_code"` Questions []*TriviaQuestion `json:"results"` }
Click to show internal directories.
Click to hide internal directories.