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