Добавлена поддержка поля threadid в json message protocol
This commit is contained in:
@@ -42,6 +42,8 @@ func msgParser(ctx context.Context, msg string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// j.Threadid может быит пустымб значит либо нам его не дали, либо дали пустым. Это нормально.
|
||||||
|
|
||||||
if exist := j.Message; exist == "" {
|
if exist := j.Message; exist == "" {
|
||||||
log.Warnf("Incorrect msg from redis, no message field: %s", msg)
|
log.Warnf("Incorrect msg from redis, no message field: %s", msg)
|
||||||
return
|
return
|
||||||
@@ -193,6 +195,7 @@ func msgParser(ctx context.Context, msg string) {
|
|||||||
message.From = j.From
|
message.From = j.From
|
||||||
message.Userid = j.Userid
|
message.Userid = j.Userid
|
||||||
message.Chatid = j.Chatid
|
message.Chatid = j.Chatid
|
||||||
|
message.Threadid = j.Threadid
|
||||||
message.Message = j.Message
|
message.Message = j.Message
|
||||||
message.Plugin = j.Plugin
|
message.Plugin = j.Plugin
|
||||||
message.Mode = j.Mode
|
message.Mode = j.Mode
|
||||||
|
|||||||
2
types.go
2
types.go
@@ -22,6 +22,7 @@ type rMsg struct {
|
|||||||
From string `json:"from,omitempty"`
|
From string `json:"from,omitempty"`
|
||||||
Chatid string `json:"chatid,omitempty"`
|
Chatid string `json:"chatid,omitempty"`
|
||||||
Userid string `json:"userid,omitempty"`
|
Userid string `json:"userid,omitempty"`
|
||||||
|
Threadid string `json:"threadid,omitempty"`
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Plugin string `json:"plugin,omitempty"`
|
Plugin string `json:"plugin,omitempty"`
|
||||||
Mode string `json:"mode,omitempty"`
|
Mode string `json:"mode,omitempty"`
|
||||||
@@ -41,6 +42,7 @@ type sMsg struct {
|
|||||||
From string `json:"from"`
|
From string `json:"from"`
|
||||||
Chatid string `json:"chatid"`
|
Chatid string `json:"chatid"`
|
||||||
Userid string `json:"userid"`
|
Userid string `json:"userid"`
|
||||||
|
Threadid string `json:"threadid"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
Plugin string `json:"plugin"`
|
Plugin string `json:"plugin"`
|
||||||
Mode string `json:"mode"`
|
Mode string `json:"mode"`
|
||||||
|
|||||||
Reference in New Issue
Block a user