bot

package
v0.0.0-...-0144ae3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptRE

func AcceptRE(text string, re *regexp.Regexp) bool

func MatchRE

func MatchRE(text string, re *regexp.Regexp) ([]string, bool)

func SetTest

func SetTest(test_key string)

func StartBot

func StartBot(bot Bot, wg *sync.WaitGroup)

func TimeTableKeyName

func TimeTableKeyName(userid string) string

Types

type Anzu

type Anzu struct {
	*BaseBot
	// contains filtered or unexported fields
}

func NewAnzu

func NewAnzu(token string, stop *chan struct{}, redisClient RedisClient) *Anzu

type BaseBot

type BaseBot struct {
	*slack.Client
	*slack.RTM
	// contains filtered or unexported fields
}

func NewBot

func NewBot(token string, stop *chan struct{}) *BaseBot

func (*BaseBot) IsBeginWithMention

func (bot *BaseBot) IsBeginWithMention(e *slack.MessageEvent) bool

func (*BaseBot) IsMentioned

func (bot *BaseBot) IsMentioned(e *slack.MessageEvent) bool

func (*BaseBot) MentionStr

func (bot *BaseBot) MentionStr() string

func (*BaseBot) PostMessage

func (bot *BaseBot) PostMessage(channel string, text string, params slack.PostMessageParameters) (string, string, error)

type Bot

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

type BusInfo

type BusInfo struct {
	MBus    []string `json:"mBus"`
	ABus    []string `json:"aBus"`
	Success bool     `json:"success"`
}

type ByStartTime

type ByStartTime []TimeTableEvent

func (ByStartTime) Len

func (a ByStartTime) Len() int

func (ByStartTime) Less

func (a ByStartTime) Less(i, j int) bool

func (ByStartTime) Swap

func (a ByStartTime) Swap(i, j int)

type Meu

type Meu struct {
	*BaseBot
	// contains filtered or unexported fields
}

func NewMeu

func NewMeu(token string, stop *chan struct{}, redisClient RedisClient) *Meu

type Subject

type Subject struct {
	Name      string
	Professor string
}

type TimeTable

type TimeTable struct {
	Year     int
	Semester int
	Days     []TimeTableDay
	Subjects []Subject
}

type TimeTableDay

type TimeTableDay struct {
	Events []TimeTableEvent
}

type TimeTableDetailResponse

type TimeTableDetailResponse struct {
	XMLName xml.Name `xml:"response"`
	TimeTableResponseBase
	Subjects []struct {
		Name struct {
			Value string `xml:"value,attr"`
		} `xml:"name"`
		Professor struct {
			Value string `xml:"value,attr"`
		} `xml:"professor"`
		Times []struct {
			Place     string `xml:"place,attr"`
			EndTime   int    `xml:"endtime,attr"`
			StartTime int    `xml:"starttime,attr"`
			Day       int    `xml:"day,attr"`
		} `xml:"time>data"`
	} `xml:"subject"`
}

type TimeTableEvent

type TimeTableEvent struct {
	Id        int
	Place     string
	StartTime int
	EndTime   int
}

type TimeTableInfo

type TimeTableInfo struct {
	Year     int
	Semester int
	Id       string
}

type TimeTableResponse

type TimeTableResponse struct {
	XMLName xml.Name                `xml:"response"`
	Tables  []TimeTableResponseBase `xml:"table"`
}

type TimeTableResponseBase

type TimeTableResponseBase struct {
	Id       string `xml:"id,attr"`
	Year     int    `xml:"year,attr"`
	Semester int    `xml:"semester,attr"`
}

Jump to

Keyboard shortcuts

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