修改过滤条件
This commit is contained in:
parent
b521264877
commit
1b498348df
1 changed files with 15 additions and 10 deletions
|
@ -21,20 +21,25 @@ func Router(data map[string]interface{}) {
|
|||
sender := data["sender"].(map[string]interface{})
|
||||
role := sender["role"].(string)
|
||||
mid := data["message_id"].(float64)
|
||||
raw_msg := data["raw_message"].(string)[1:]
|
||||
|
||||
parms := strings.Fields(raw_msg)
|
||||
//包含发送消息的'!'
|
||||
raw_msg := data["raw_message"].(string)
|
||||
if raw_msg[0] == '!' {
|
||||
// 去除'!'
|
||||
raw_msg = raw_msg[1:]
|
||||
parms := strings.Fields(raw_msg)
|
||||
|
||||
worker := workers.NewWorker(parms, fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg)
|
||||
worker := workers.NewWorker(parms, fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg)
|
||||
|
||||
// fmt.Println("router:", parms[0])
|
||||
// fmt.Println("CheckPermission:", worker.CheckPermission())
|
||||
// ans := NewStdAns(parms[0], fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg)
|
||||
message := worker.CheckPermission()
|
||||
if message == "0" {
|
||||
message = worker.GetMsg()
|
||||
worker.SendMsg(message)
|
||||
// fmt.Println("router:", parms[0])
|
||||
// fmt.Println("CheckPermission:", worker.CheckPermission())
|
||||
// ans := NewStdAns(parms[0], fmt.Sprintf("%d", int(uid)), fmt.Sprintf("%d", int(gid)), role, fmt.Sprintf("%d", int(mid)), raw_msg)
|
||||
message := worker.CheckPermission()
|
||||
if message == "0" {
|
||||
message = worker.GetMsg()
|
||||
worker.SendMsg(message)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue