plugins

package
v0.0.0-...-49cf9ae Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMessageKeyword

func CheckMessageKeyword(message string, keyword string) (bool, string)

Types

type BotEvent

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

func NewBotEvent

func NewBotEvent(sender MessageSender, botID, botName, senderID, senderName, text, channel string) BotEvent

func NewTestEvent

func NewTestEvent(message string) BotEvent

func (*BotEvent) BaseText

func (b *BotEvent) BaseText() string

func (*BotEvent) BotCmdArgs

func (b *BotEvent) BotCmdArgs(message string) ([]string, bool)

func (*BotEvent) BotID

func (b *BotEvent) BotID() string

func (*BotEvent) BotLinkID

func (b *BotEvent) BotLinkID() string

func (*BotEvent) BotLinkIDForClient

func (b *BotEvent) BotLinkIDForClient() string

func (*BotEvent) BotName

func (b *BotEvent) BotName() string

func (*BotEvent) Channel

func (b *BotEvent) Channel() string

func (*BotEvent) GetMessageSender

func (b *BotEvent) GetMessageSender() MessageSender

func (*BotEvent) Reply

func (b *BotEvent) Reply(message string)

func (*BotEvent) SendMessage

func (b *BotEvent) SendMessage(message string, channel string)

func (*BotEvent) SenderID

func (b *BotEvent) SenderID() string

func (*BotEvent) SenderName

func (b *BotEvent) SenderName() string

type BotID

type BotID string

func (BotID) Equal

func (b BotID) Equal(bot string) bool

func (BotID) LinkID

func (b BotID) LinkID() string

type BotMessagePlugin

type BotMessagePlugin interface {
	CheckMessage(event BotEvent, message string) (bool, string)
	DoAction(event BotEvent, message string) bool
	Help() string
}

type DebugMessageSender

type DebugMessageSender struct {
}

func (DebugMessageSender) SendMessage

func (b DebugMessageSender) SendMessage(message string, channel string)

type MessageSender

type MessageSender interface {
	SendMessage(message string, channel string)
}

type Plugin

type Plugin struct {
	Key interface{}
	BotMessagePlugin
}

func (Plugin) Name

func (p Plugin) Name() string

type PluginManager

type PluginManager interface {
	AddPlugin(key interface{}, val BotMessagePlugin)
	ExecPlugins(botEvent BotEvent)
	StopReply()
	StartReply()
	IsReply() bool
	GetPlugins() []Plugin // deepCopy
}

func NewPluginManager

func NewPluginManager(sender MessageSender) PluginManager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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