go-bot/workers/ping.go

25 lines
439 B
Go

package workers
import (
"go-bot/config"
"slices"
)
func init() {
plugins := config.GetConfig()["PLUGINS"].([]interface{})
if slices.Contains(plugins, "ping") {
RegisterWorkerFactory("ping", func(parms []string, uid, gid, role, mid, rawMsg string) Worker {
return &Ping{
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
}
})
}
}
type Ping struct {
*StdAns
}
func (a *Ping) GetMsg() string {
return "Pong!"
}