1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 17:44:05 +08:00

opt alpha

This commit is contained in:
bergyu 2021-11-08 19:18:02 +08:00
parent 564c5a4f68
commit cc449ecc1c

View File

@ -74,8 +74,12 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典", Configs: map[string]
_alpha_find(m, kit.Select(WORD, arg, 2), arg[1]) _alpha_find(m, kit.Select(WORD, arg, 2), arg[1])
} }
}}, }},
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(CACHE, mdb.REMOVE)
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) < 2 { if len(arg) < 2 {
m.Cmdy(CACHE, kit.Select("", arg, 1))
return return
} }
defer m.StatusTimeCountTotal(m.Config(kit.MDB_COUNT)) defer m.StatusTimeCountTotal(m.Config(kit.MDB_COUNT))
@ -90,7 +94,6 @@ var Index = &ice.Context{Name: ALPHA, Help: "英汉词典", Configs: map[string]
} }
if _alpha_find(m, arg[0], arg[1]); arg[0] == WORD && m.Length() > 0 { if _alpha_find(m, arg[0], arg[1]); arg[0] == WORD && m.Length() > 0 {
m.Cmd(CACHE, mdb.CREATE, m.AppendSimple()) m.Cmd(CACHE, mdb.CREATE, m.AppendSimple())
m.Sort(kit.MDB_KEY)
} }
}}, }},
}} }}