2016-12-11 16:06:17 +00:00
|
|
|
package main
|
|
|
|
import "html/template"
|
|
|
|
|
|
|
|
func init() {
|
2016-12-16 10:37:42 +00:00
|
|
|
plugins["helloworld"] = Plugin{"helloworld","Hello World","Azareal","http://github.com/Azareal","",false,"","",init_helloworld,nil,deactivate_helloworld}
|
2016-12-11 16:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// init_helloworld is separate from init() as we don't want the plugin to run if the plugin is disabled
|
|
|
|
func init_helloworld() {
|
|
|
|
add_hook("rrow_assign", helloworld_reply)
|
|
|
|
}
|
|
|
|
|
2016-12-13 02:14:14 +00:00
|
|
|
func deactivate_helloworld() {
|
|
|
|
remove_hook("rrow_assign")
|
|
|
|
}
|
|
|
|
|
2016-12-11 16:06:17 +00:00
|
|
|
func helloworld_reply(data interface{}) interface{} {
|
|
|
|
reply := data.(Reply)
|
|
|
|
reply.Content = "Hello World!"
|
|
|
|
reply.ContentHtml = template.HTML("Hello World!")
|
2016-12-13 02:14:14 +00:00
|
|
|
reply.Tag = "Auto"
|
2016-12-11 16:06:17 +00:00
|
|
|
return reply
|
|
|
|
}
|