修改为校验权限不通过不回复
This commit is contained in:
parent
e1f9c56155
commit
48243b79d5
5 changed files with 17 additions and 15 deletions
|
@ -0,0 +1 @@
|
||||||
|
# 使用Go语言重新实现 [sihuan/XZZ](https://github.com/sihuan/XZZ) 机器人项目
|
1
test/test.go
Normal file
1
test/test.go
Normal file
|
@ -0,0 +1 @@
|
||||||
|
package test
|
|
@ -32,9 +32,10 @@ func Router(data map[string]interface{}) {
|
||||||
message := worker.CheckPermission()
|
message := worker.CheckPermission()
|
||||||
if message != "0" {
|
if message != "0" {
|
||||||
worker.SendMsg(message)
|
worker.SendMsg(message)
|
||||||
} else {
|
} //else {
|
||||||
message = worker.GetMsg()
|
|
||||||
worker.SendMsg(message)
|
// message = worker.GetMsg()
|
||||||
}
|
// worker.SendMsg(message)
|
||||||
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
package workers
|
package workers
|
||||||
|
|
||||||
import "fmt"
|
type Emm struct {
|
||||||
|
|
||||||
type Emmm struct {
|
|
||||||
*StdAns
|
*StdAns
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Emmm) GetMsg() string {
|
func (a *Emm) GetMsg() string {
|
||||||
a.BlockGroup = []string{"874769998"}
|
return "-1"
|
||||||
|
// a.BlockGroup = []string{"874769998"}
|
||||||
|
|
||||||
fmt.Println(a.CheckPermission())
|
// fmt.Println(a.CheckPermission())
|
||||||
if a.CheckPermission() != "0" {
|
// if a.CheckPermission() != "0" {
|
||||||
return a.CheckPermission()
|
// return a.CheckPermission()
|
||||||
}
|
// }
|
||||||
return "咱也不知道" + a.Parms[0] + "是啥呢~"
|
// return "咱也不知道" + a.Parms[0] + "是啥呢~"
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ func NewWorker(parms []string, uid, gid, role, mid, rawMsg string) Worker {
|
||||||
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
|
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg),
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return &Emmm{
|
return &Emm{
|
||||||
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg)}
|
StdAns: NewStdAns(parms, uid, gid, role, mid, rawMsg)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue