- package example
- import (
- //"fmt"
- "PluginExample/plugins"
- )
- func echo(msg string)string {
- result := "returning: " + msg
- return result
- }
- func init() {
- var commands plugins.Command
- commands.Name = "!echo"
- commands.Callback = func(args ...interface{})(string) {
- result := echo(args[0].(string))
- return result
- }
- var p plugins.PluginInfo
- p.Name = "Example Echo"
- p.About = "Example plugin to repeat what is sent to it"
- p.Commands = commands
- p.AddPluginInfo()
- }