questagbot

package
v0.0.0-...-4acabe8 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const HelpText string = "" /* 147-byte string literal not displayed */

Help Text!!!

Variables

This section is empty.

Functions

This section is empty.

Types

type Gamer

type Gamer struct {
	ChatID          int        `json:"chat_id"`
	Questions       []Question `json:"questions"`
	CurrentQuestion int        `json:"current_question"`
	RightAnswers    int        `json:"right_answers"`
	WrongAnswers    int        `json:"wrong_answers"`
	Username        string     `json:"username"`
}

Gamer is object to store in appengine datastore

func (*Gamer) GetAccuracy

func (gamer *Gamer) GetAccuracy() float32

GetAccuracy - return persentage of right answers

func (*Gamer) GetCurrentQuestion

func (gamer *Gamer) GetCurrentQuestion() Question

GetCurrentQuestion is helper method to get current question

func (*Gamer) GetKeyboard

func (gamer *Gamer) GetKeyboard() *telegram.ReplyKeyboardMarkup

GetKeyboard helper to generate keyboard markup

func (*Gamer) NextQuestion

func (gamer *Gamer) NextQuestion() Question

NextQuestion return next question

type GamerData

type GamerData struct {
	GamerBlob    string
	RightAnswers int64
	WrongAnswers int64
	Gamer        *Gamer `datastore:"-"`
}

GamerData is wrapper for appengine data store

func (*GamerData) Load

func (data *GamerData) Load(p []datastore.Property) error

Load is google store Question struct loader

func (*GamerData) Save

func (data *GamerData) Save() ([]datastore.Property, error)

Save is google store Question struct saver

type Global

type Global struct {
	InstagramClientID string
	Tags              []string
	TelegramKey       string
}

Global is struct for saving state

type Question

type Question struct {
	Answer   string   `json:"answer"`
	Variants []string `json:"variants"`
}

Question is struct to store question object

Jump to

Keyboard shortcuts

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