bot

package
v0.0.0-...-bee29bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoActiveServers = errors.New("no active servers available")
)

Functions

This section is empty.

Types

type BackoffFunc

type BackoffFunc func(retry int) (sleep time.Duration)

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func NewBot

func NewBot() *Bot

func (*Bot) Run

func (b *Bot) Run(ctx context.Context) error

type Question

type Question struct {
	// contains filtered or unexported fields
}

func NewQuestion

func NewQuestion(r trivia.Result) Question

func (Question) Answers

func (q Question) Answers() string

func (Question) CorrectAnswer

func (q Question) CorrectAnswer() string

func (Question) IsCorrectAnswer

func (q Question) IsCorrectAnswer(answer string) bool

func (Question) Question

func (q Question) Question() string

type QuestionFactory

type QuestionFactory struct {
	// contains filtered or unexported fields
}

func NewQuestionFactory

func NewQuestionFactory() QuestionFactory

func (*QuestionFactory) Next

func (q *QuestionFactory) Next(ctx context.Context) (question Question, err error)

type ServerFactory

type ServerFactory struct {
	// contains filtered or unexported fields
}

func NewServerFactory

func NewServerFactory() ServerFactory

func (*ServerFactory) Next

func (s *ServerFactory) Next(ctx context.Context) (servers.Server, error)

type State

type State struct {
	// contains filtered or unexported fields
}

func NewState

func NewState(qf *QuestionFactory) *State

func (*State) Answer

func (s *State) Answer(username, answer string) (string, bool)

func (*State) Running

func (s *State) Running() bool

func (*State) Score

func (s *State) Score(playerName string) string

func (*State) Start

func (s *State) Start(ctx context.Context) (chatLine string, err error)

func (*State) Top

func (s *State) Top() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL