From 45c7ede5cf0898279506459c269c52e8e573d520 Mon Sep 17 00:00:00 2001 From: bergyu Date: Wed, 21 Jul 2021 21:22:51 +0800 Subject: [PATCH] opt chrome --- misc/chrome/sync.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/misc/chrome/sync.go b/misc/chrome/sync.go index 78a8f350..17dfaa93 100644 --- a/misc/chrome/sync.go +++ b/misc/chrome/sync.go @@ -2,6 +2,8 @@ package crx import ( ice "github.com/shylinux/icebergs" + "github.com/shylinux/icebergs/base/cli" + "github.com/shylinux/icebergs/base/ctx" "github.com/shylinux/icebergs/base/mdb" kit "github.com/shylinux/toolkits" ) @@ -22,7 +24,16 @@ func init() { )}, }, Commands: map[string]*ice.Command{ - "/page": {Name: "/page", Help: "网页", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + "/page": {Name: "/page", Help: "网页", Action: map[string]*ice.Action{ + ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) { + if arg[0] == cli.RUN { + m.Cmdy(arg[1:]) + return + } + m.Cmdy(ctx.COMMAND, arg) + }}, + }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + }}, "/sync": {Name: "/sync", Help: "同步", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Cmdy(SYNC, mdb.INSERT, arg)