1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-27 01:48:27 +08:00
icebergs/core/chat/header.go
2020-06-02 10:45:57 +08:00

26 lines
617 B
Go

package chat
import (
"github.com/shylinux/icebergs"
"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(ice.WEB_SERVE, "meta.title"))
}
}},
}}, nil)
}