1
0
forked from x/icebergs
icebergs/core/chat/cmd.go
2023-12-02 17:04:45 +08:00

27 lines
563 B
Go

package chat
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
)
const CMD = "cmd"
func init() {
Index.MergeCommands(ice.Commands{
CMD: {Help: "命令", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
switch cmd := kit.Select(web.WIKI_WORD, arg, 0); cmd {
case web.CHAT_PORTAL:
web.RenderMain(m)
default:
if m.IsCliUA() {
m.Cmdy(arg, m.Optionv(ice.ARG)).RenderResult()
} else {
web.RenderCmd(m, cmd, kit.Slice(arg, 1))
}
}
}},
})
}