1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 09:34:05 +08:00
icebergs/core/wiki/order.go
2021-07-26 20:51:12 +08:00

31 lines
807 B
Go

package wiki
import (
"strings"
ice "github.com/shylinux/icebergs"
kit "github.com/shylinux/toolkits"
)
func _order_show(m *ice.Message, text string, arg ...string) {
m.Optionv(kit.MDB_LIST, kit.Split(strings.TrimSpace(text), ice.MOD_NL))
_wiki_template(m, ORDER, "", text, arg...)
}
const ORDER = "order"
func init() {
Index.Merge(&ice.Context{
Commands: map[string]*ice.Command{
ORDER: {Name: "order `[item\n]...`", Help: "列表", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
_order_show(m, arg[0], arg[1:]...)
}},
},
Configs: map[string]*ice.Config{
ORDER: {Name: ORDER, Help: "列表", Value: kit.Data(
kit.MDB_TEMPLATE, `<ul {{.OptionTemplate}}>{{range $index, $value := .Optionv "list"}}<li>{{$value}}</li>{{end}}</ul>`,
)},
},
})
}