plugins

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2017 License: MIT Imports: 3 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUtils = NewUtils(nil)

DefaultUtils default utils

Functions

func CheckMessageKeyword

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

CheckMessageKeyword is Deprecated

func CheckMessageKeywords

func CheckMessageKeywords(message string, keywords ...string) (bool, string)

Types

type BotEvent

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

func NewBotEvent

func NewBotEvent(sender MessageSender, domain, botID, botName, senderID, senderName, text, channelID, channelName, timestamp string) BotEvent

func NewTestEvent

func NewTestEvent(message string) BotEvent

func (*BotEvent) ArchivesURL

func (b *BotEvent) ArchivesURL() string

ArchivesURL return copy link archives url

func (*BotEvent) BaseText

func (b *BotEvent) BaseText() string

func (*BotEvent) BotCmdArgs

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

func (*BotEvent) BotCmdMessage

func (b *BotEvent) BotCmdMessage(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

Channel is Deprecated

func (*BotEvent) ChannelID

func (b *BotEvent) ChannelID() string

func (*BotEvent) ChannelName

func (b *BotEvent) ChannelName() 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

type Utils

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

Utils util

func NewUtils

func NewUtils(replacer *strings.Replacer) *Utils

NewUtils return a utils

func (Utils) QuotationOrSpaceFields

func (u Utils) QuotationOrSpaceFields(s string) []string

QuotationOrSpaceFields シングルクォーテーションとダブルクォーテーションを考慮して文字列を空白区切りします

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

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