This commit is contained in:
parent
9c78ea2d48
commit
7c684af8c3
79 changed files with 3594 additions and 3257 deletions
28
internal/model/plugin.go
Normal file
28
internal/model/plugin.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrPluginNotFound is returned when a requested plugin doesn't exist
|
||||
ErrPluginNotFound = errors.New("plugin not found")
|
||||
)
|
||||
|
||||
// Plugin defines the interface all chat plugins must implement
|
||||
type Plugin interface {
|
||||
// GetID returns the plugin ID
|
||||
GetID() string
|
||||
|
||||
// GetName returns the plugin name
|
||||
GetName() string
|
||||
|
||||
// GetHelp returns the plugin help text
|
||||
GetHelp() string
|
||||
|
||||
// RequiresConfig indicates if the plugin requires configuration
|
||||
RequiresConfig() bool
|
||||
|
||||
// OnMessage processes an incoming message and returns response messages
|
||||
OnMessage(msg *Message, config map[string]interface{}) []*Message
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue