lib

package
v0.0.0-...-196077c Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FantailSaveErr = errors.New("Fantail issue trying to save to storage")
View Source
var FantailStorageErr = errors.New("Fantail storage is not enabled")

Functions

This section is empty.

Types

type Action

type Action interface {
	// contains filtered or unexported methods
}

func NewAction

func NewAction(s *session, actionName string) Action

type AskAction

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

type ByDate

type ByDate Notes

func (ByDate) Len

func (this ByDate) Len() int

func (ByDate) Less

func (this ByDate) Less(i, j int) bool

func (ByDate) Swap

func (this ByDate) Swap(i, j int)

type ChatAction

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

type CheckInTask

type CheckInTask struct{}

type FollowUp

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

func NewFollowUp

func NewFollowUp(s *session) *FollowUp

func (*FollowUp) Start

func (this *FollowUp) Start()

func (*FollowUp) Stop

func (this *FollowUp) Stop()

type FollowupTask

type FollowupTask struct{}

type GatherTask

type GatherTask struct{}

type HelpAction

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

type Incoming

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

type Keyboard

type Keyboard [][]string

type Note

type Note struct {
	UserId    int
	Added     time.Time
	Updated   time.Time
	Remind    time.Time
	Completed time.Time
	Tag       string
	Context   []string
	Text      string
}

func NewNote

func NewNote(msg telebot.Message, tags ...string) *Note

func (*Note) Complete

func (this *Note) Complete()

func (*Note) IsCurrent

func (this *Note) IsCurrent() bool

func (Note) IsEmpty

func (this Note) IsEmpty() bool

func (*Note) RemindToday

func (this *Note) RemindToday() bool

func (*Note) SetContext

func (this *Note) SetContext(context ...string)

func (*Note) ToString

func (this *Note) ToString() string

func (*Note) Update

func (this *Note) Update()

type Notes

type Notes []*Note

func (Notes) FilterOnTag

func (this Notes) FilterOnTag(tag string) Notes

func (Notes) FilterOnTxt

func (this Notes) FilterOnTxt(txt string) Notes

func (Notes) ForNextDays

func (this Notes) ForNextDays(days int) Notes

func (Notes) MostRecent

func (this Notes) MostRecent() *Note

func (Notes) SortByDate

func (this Notes) SortByDate() Notes

func (Notes) ToString

func (this Notes) ToString() string

type Question

type Question struct {
	RelatesTo struct {
		Answers []string `json:"answers"`
		Save    bool     `json:"save"`
		SaveTag string   `json:"saveTag"`
	} `json:"relatesTo"`
	Context         []string `json:"context"`
	QuestionText    string   `json:"question"`
	PossibleAnswers []string `json:"answers"`
}

type Questions

type Questions []*Question

func (Questions) First

func (this Questions) First() *Question

type ReviewAction

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

type SayAction

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

type Sticker

type Sticker struct {
	Ids     []string `json:"ids"`
	Meaning string   `json:"meaning"`
	SaveTag string   `json:"saveTag"`
}

func (Sticker) ToNote

func (this Sticker) ToNote(msg telebot.Message, tags ...string) Note

type StickerChatAction

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

type Stickers

type Stickers []*Sticker

func LoadKnownStickers

func LoadKnownStickers() Stickers

func (Stickers) FindSticker

func (this Stickers) FindSticker(id string) *Sticker

type Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) Get

func (a *Storage) Get(userId string) (Notes, error)

func (*Storage) GetUsers

func (a *Storage) GetUsers() ([]int, error)

func (*Storage) Save

func (a *Storage) Save(userId string, n *Note) error

func (*Storage) Update

func (a *Storage) Update(userId string, o *Note, n *Note) error

type Task

type Task interface {
	// contains filtered or unexported methods
}

type Tasks

type Tasks []Task

type User

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

func (*User) AddOrUpdate

func (this *User) AddOrUpdate(users Users) Users

func (*User) FollowUp

func (this *User) FollowUp() Notes

func (*User) ToBotUser

func (this *User) ToBotUser() telebot.User

type Users

type Users []*User

func (Users) GetUser

func (this Users) GetUser(id int) *User

type Worker

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

func NewWorker

func NewWorker(b *telebot.Bot, s *Storage) *Worker

func (*Worker) DoFollowUp

func (this *Worker) DoFollowUp()

func (*Worker) ProcessMessages

func (this *Worker) ProcessMessages(input <-chan telebot.Message)

Jump to

Keyboard shortcuts

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