forked from x/ContextOS
some
This commit is contained in:
parent
121f016ebd
commit
7af0e65bfc
@ -2908,7 +2908,8 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
m.Add("append", "res", msg.Result(0))
|
m.Add("append", "res", msg.Result(0))
|
||||||
} else {
|
} else {
|
||||||
m.Add("append", "index", i)
|
m.Add("append", "index", i)
|
||||||
m.Add("append", "command", fmt.Sprintf("%s: %s", c.Help, strings.Replace(c.Name, "\n", "\\n", -1)))
|
m.Add("append", "help", fmt.Sprintf("%s", c.Help))
|
||||||
|
m.Add("append", "command", fmt.Sprintf("%s", strings.Replace(c.Name, "\n", "\\n", -1)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2935,18 +2936,20 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
m.target.Commands[m.Cap("list_count")] = &Command{Name: strings.Join(arg, " "), Help: list_help, Hand: func(cmd *Message, c *Context, key string, args ...string) {
|
m.target.Commands[m.Cap("list_count")] = &Command{Name: strings.Join(arg, " "), Help: list_help, Hand: func(cmd *Message, c *Context, key string, args ...string) {
|
||||||
list := []string{}
|
list := []string{}
|
||||||
for _, v := range arg {
|
for _, v := range arg {
|
||||||
if v == "_" {
|
if v == "__" {
|
||||||
if len(args) > 0 {
|
|
||||||
v, args = args[0], args[1:]
|
|
||||||
} else {
|
|
||||||
v = "''"
|
|
||||||
}
|
|
||||||
} else if v == "__" {
|
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
v, args = args[0], args[1:]
|
v, args = args[0], args[1:]
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
} else if strings.HasPrefix(v, "_") {
|
||||||
|
if len(args) > 0 {
|
||||||
|
v, args = args[0], args[1:]
|
||||||
|
} else if len(v) > 1 {
|
||||||
|
v = v[1:]
|
||||||
|
} else {
|
||||||
|
v = "''"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
list = append(list, v)
|
list = append(list, v)
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ import (
|
|||||||
|
|
||||||
// 应用层
|
// 应用层
|
||||||
_ "examples/code" //代码中心
|
_ "examples/code" //代码中心
|
||||||
_ "examples/jira" //任务中心
|
// _ "examples/jira" //任务中心
|
||||||
_ "examples/lark" //会议中心
|
// _ "examples/lark" //会议中心
|
||||||
_ "examples/mall" //交易中心
|
// _ "examples/mall" //交易中心
|
||||||
_ "examples/wiki" //文档中心
|
_ "examples/wiki" //文档中心
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user