go-bot/workers/newworker.go

34 lines
743 B
Go
Raw Normal View History

2024-04-01 09:42:29 +08:00
package workers
import "fmt"
func NewWorker(parms []string, uid, gid, role, mid, rawMsg string) Worker {
fmt.Println("NewWorker:", parms)
switch parms[0] {
case "ping":
return &Ping{
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
}
// 在这里添加其他 worker 的 case
case "pkg":
return &Pkg{
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
}
2024-04-14 19:08:12 +08:00
case "hhsh":
return &Hhsh{
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
}
2024-04-14 21:41:50 +08:00
case "ip":
return &Ip{
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
}
2024-04-23 20:38:37 +08:00
case "lsp":
return &Lsp{
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
}
2024-04-01 09:42:29 +08:00
default:
return &Emm{
2024-04-01 09:42:29 +08:00
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg)}
}
}