Documentation ¶
Overview ¶
Package sample is a sample implementation of a plugin. Use this as a place to start to build a plugin
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct{}
Plugin initializes the interface
func (*Plugin) HandleMessage ¶
HandleMessage is responsible for handling the incoming message and returning a response based on the message provided
Example ¶
package main import ( "fmt" "github.com/handwritingio/deckard-bot/message" ) func main() { p := new(Plugin) fmt.Println(p.HandleMessage(format("!sample")).Text) fmt.Println(rePluginRegexp.MatchString("!sample")) } func format(text string) message.Basic { return message.Basic{ ID: 1, Text: text, Finished: true, } }
Output: Sample Plugin Output true
func (*Plugin) OnInit ¶
OnInit returns an error if the plugin could not be started OnInit doesn't do anything here as nothing needs to be initialized for this plugin
Click to show internal directories.
Click to hide internal directories.