Documentation
¶
Overview ¶
Package slacker provides methods for for bootstraping Slack bots
Index ¶
Constants ¶
View Source
const ( STATUS_NONE uint = 0 STATUS_TYPING = 1 STATUS_EMOJI = 2 )
Status types
View Source
const VERSION = "9.0.0"
VERSION is current package version
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bot ¶
type Bot struct {
Token string // Auth token
BotName string // Bot name
AllowDM bool // Allow direct messages
StatusType uint8 // Processing status mark type
Started int64 // Bot start timestamp
UserListUpdatePeriod int // User list update period in seconds
ErrorHandler func(err error)
ConnectHandler func()
HelloHandler func() string
UnknownCommandHandler func(user User, cmd string, args []string) string
CommandHandlers map[string]CommandHandler
// contains filtered or unexported fields
}
Bot is basic bot struct
func (*Bot) FetchUsers ¶
fetchUsers fetches users and creates map id->name
func (*Bot) NormalizeInput ¶
NormalizeInput normalizes links and usernames in a message
func (*Bot) PostMessage ¶
PostMessage posts mesasge
func (*Bot) SendMessage ¶
SendMessage sends simple message to some user
type CommandHandler ¶
CommandHandler is command handler
Click to show internal directories.
Click to hide internal directories.