From 48243b79d5efbc18c05b914906774fed706418ed Mon Sep 17 00:00:00 2001 From: liyp Date: Tue, 2 Apr 2024 16:37:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B8=8D=E9=80=9A=E8=BF=87=E4=B8=8D=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + test/test.go | 1 + utils/router.go | 9 +++++---- workers/emm.go | 19 +++++++++---------- workers/newworker.go | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 test/test.go diff --git a/README.md b/README.md index e69de29..3c29f79 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +# 使用Go语言重新实现 [sihuan/XZZ](https://github.com/sihuan/XZZ) 机器人项目 diff --git a/test/test.go b/test/test.go new file mode 100644 index 0000000..56e5404 --- /dev/null +++ b/test/test.go @@ -0,0 +1 @@ +package test diff --git a/utils/router.go b/utils/router.go index a163a65..330f165 100644 --- a/utils/router.go +++ b/utils/router.go @@ -32,9 +32,10 @@ func Router(data map[string]interface{}) { message := worker.CheckPermission() if message != "0" { worker.SendMsg(message) - } else { - message = worker.GetMsg() - worker.SendMsg(message) - } + } //else { + + // message = worker.GetMsg() + // worker.SendMsg(message) + //} } diff --git a/workers/emm.go b/workers/emm.go index d8f4854..2cb4a33 100644 --- a/workers/emm.go +++ b/workers/emm.go @@ -1,17 +1,16 @@ package workers -import "fmt" - -type Emmm struct { +type Emm struct { *StdAns } -func (a *Emmm) GetMsg() string { - a.BlockGroup = []string{"874769998"} +func (a *Emm) GetMsg() string { + return "-1" + // a.BlockGroup = []string{"874769998"} - fmt.Println(a.CheckPermission()) - if a.CheckPermission() != "0" { - return a.CheckPermission() - } - return "咱也不知道" + a.Parms[0] + "是啥呢~" + // fmt.Println(a.CheckPermission()) + // if a.CheckPermission() != "0" { + // return a.CheckPermission() + // } + // return "咱也不知道" + a.Parms[0] + "是啥呢~" } diff --git a/workers/newworker.go b/workers/newworker.go index 297196e..5561673 100644 --- a/workers/newworker.go +++ b/workers/newworker.go @@ -15,7 +15,7 @@ func NewWorker(parms []string, uid, gid, role, mid, rawMsg string) Worker { StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg), } default: - return &Emmm{ + return &Emm{ StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg)} } }