Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnswerResult ¶
type Quest ¶
type Quest struct {
// contains filtered or unexported fields
}
func (Quest) CreateInitialState ¶
func (Quest) GetPicture ¶
func (Quest) GetQuestion ¶
type QuestEngine ¶
type QuestEngine interface { StartQuest(userID tgbotbase.UserID, questID string) error CheckAnswer(userID tgbotbase.UserID, answer string) AnswerResult GetCurrentQuestion(userID tgbotbase.UserID) tgbotapi.Chattable AddQuest(questID string, quest Quest) }
func NewQuestEngine ¶
func NewQuestEngine(pool tgbotbase.RedisPool, resmon ResultMonitor) QuestEngine
type QuestRecord ¶
type QuestRecord struct {
// contains filtered or unexported fields
}
func NewQuestRecord ¶
func NewQuestRecord(questID string, quest Quest) *QuestRecord
type QuestStorage ¶
type QuestStorage interface { StoreQuest(quest QuestRecord) error StoreStage(questID string, stage StageRecord) error LoadAll() ([]QuestRecord, error) LoadQuest(questID string) (*Quest, error) LoadStage(questID, stageID string) (*Stage, error) }
func NewRedisQuestStorage ¶
func NewRedisQuestStorage(pool tgbotbase.RedisPool) QuestStorage
type ResultMonitor ¶
type ResultMonitor interface { QuestStarted(questID string, userID tgbotbase.UserID, t time.Time) QuestFinished(questID string, userID tgbotbase.UserID, t time.Time) QuestionAnsweredCorrectly(questID string, userID tgbotbase.UserID, t time.Time) QuestionAnsweredIncorrectly(questID string, userID tgbotbase.UserID, t time.Time) // TODO: remove this piece of code somewhere else - it is not the correct place for this code SendStats(questID string) }
func NewTGResultMonitor ¶
type Stage ¶
type Stage struct {
// contains filtered or unexported fields
}
func (*Stage) AddPicture ¶
type StageRecord ¶
type StageRecord struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.