修改为校验权限不通过不回复

This commit is contained in:
liyp 2024-04-02 16:37:26 +08:00
parent e1f9c56155
commit 48243b79d5
5 changed files with 17 additions and 15 deletions

View file

@ -0,0 +1 @@
# 使用Go语言重新实现 [sihuan/XZZ](https://github.com/sihuan/XZZ) 机器人项目

1
test/test.go Normal file
View file

@ -0,0 +1 @@
package test

View file

@ -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)
//}
}

View file

@ -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] + "是啥呢~"
}

View file

@ -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)}
}
}