1
0
forked from x/icebergs
This commit is contained in:
harveyshao 2021-08-12 01:51:54 +08:00
parent c555545cea
commit 42e7365f79

View File

@ -51,8 +51,7 @@ const (
const TITLE = "title" const TITLE = "title"
func init() { func init() {
Index.Merge(&ice.Context{ Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
Commands: map[string]*ice.Command{
TITLE: {Name: "title [premenu|chapter|section|endmenu] text", Help: "标题", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { TITLE: {Name: "title [premenu|chapter|section|endmenu] text", Help: "标题", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) == 0 { if len(arg) == 0 {
ns := kit.Split(ice.Info.NodeName, "-") ns := kit.Split(ice.Info.NodeName, "-")
@ -67,8 +66,7 @@ func init() {
_title_show(m, "", arg[0], arg[1:]...) _title_show(m, "", arg[0], arg[1:]...)
} }
}}, }},
}, }, Configs: map[string]*ice.Config{
Configs: map[string]*ice.Config{
TITLE: {Name: TITLE, Help: "标题", Value: kit.Data( TITLE: {Name: TITLE, Help: "标题", Value: kit.Data(
kit.MDB_TEMPLATE, `<{{.Option "level"}} {{.OptionTemplate}}>{{.Option "prefix"}} {{.Option "text"}}</{{.Option "level"}}>`, kit.MDB_TEMPLATE, `<{{.Option "level"}} {{.OptionTemplate}}>{{.Option "prefix"}} {{.Option "text"}}</{{.Option "level"}}>`,
PREMENU, `<ul {{.OptionTemplate}}></ul>`, PREMENU, `<ul {{.OptionTemplate}}></ul>`,
@ -76,6 +74,5 @@ func init() {
{{range $index, $value := Value $menu "list"}}<li>{{Value $value "prefix"}} {{Value $value "text"}}</li>{{end}} {{range $index, $value := Value $menu "list"}}<li>{{Value $value "prefix"}} {{Value $value "text"}}</li>{{end}}
</ul>`, </ul>`,
)}, )},
}, }})
})
} }