helperbot/interfaces.go

35 lines
706 B
Go
Raw Normal View History

2019-11-13 00:45:56 +00:00
package helperbot
2019-11-22 18:37:15 +00:00
import (
"time"
"github.com/nlopes/slack"
)
2019-11-13 00:45:56 +00:00
type Model interface {
SendMessage(src, dest string, message slack.Message)
GetSlackAdminDMId() (string, error)
2019-11-22 18:37:15 +00:00
GetSlackLatency() time.Duration
2019-11-13 00:45:56 +00:00
GetBytes(path []string) ([]byte, error)
SetBytes(path []string, val []byte) error
GetString(path []string) (string, error)
SetString(path []string, val string) error
2022-12-01 13:28:02 +00:00
GetInt(path []string) (int, error)
SetInt(path []string, val int) error
2019-11-13 00:45:56 +00:00
}
type Message interface {
GetSource() string
GetDestination() string
GetMessage() slack.Message
}
type PluginState interface {
Name() string
Initialize(Model) error
ProcessMessage(Message)
2019-11-22 18:37:15 +00:00
ProcessRTMEvent(slack.RTMEvent)
2019-11-13 00:45:56 +00:00
Run()
Exit()
}