2016-12-11 16:06:17 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
func init() {
|
2017-01-05 14:41:14 +00:00
|
|
|
plugins["helloworld"] = NewPlugin("helloworld","Hello World","Azareal","http://github.com/Azareal","","","",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() {
|
2017-01-05 14:41:14 +00:00
|
|
|
plugins["helloworld"].AddHook("rrow_assign", helloworld_reply)
|
2016-12-11 16:06:17 +00:00
|
|
|
}
|
|
|
|
|
2016-12-13 02:14:14 +00:00
|
|
|
func deactivate_helloworld() {
|
2017-01-05 14:41:14 +00:00
|
|
|
plugins["helloworld"].RemoveHook("rrow_assign", helloworld_reply)
|
2016-12-13 02:14:14 +00:00
|
|
|
}
|
|
|
|
|
2016-12-11 16:06:17 +00:00
|
|
|
func helloworld_reply(data interface{}) interface{} {
|
|
|
|
reply := data.(Reply)
|
|
|
|
reply.Content = "Hello World!"
|
2017-02-11 14:51:16 +00:00
|
|
|
reply.ContentHtml = "Hello World!"
|
2016-12-13 02:14:14 +00:00
|
|
|
reply.Tag = "Auto"
|
2016-12-11 16:06:17 +00:00
|
|
|
return reply
|
|
|
|
}
|