1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
icebergs/core/chat/header.go
2020-06-20 15:15:46 +08:00

27 lines
654 B
Go

package chat
import (
"github.com/shylinux/icebergs"
"github.com/shylinux/icebergs/base/web"
"github.com/shylinux/toolkits"
)
func init() {
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
"/header": {Name: "/header", Help: "标题栏", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
switch kit.Select("", arg, 0) {
case "check":
if m.Option(ice.MSG_USERNAME) != "" {
m.Echo(m.Option(ice.MSG_USERNAME))
}
case "login":
if m.Option(ice.MSG_USERNAME) != "" {
m.Render(m.Option(ice.MSG_USERNAME))
}
default:
m.Echo(m.Conf(web.SERVE, "meta.title"))
}
}},
}}, nil)
}