Добавлена поддержка поля threadid
This commit is contained in:
@@ -27,6 +27,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"`
|
||||||
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"`
|
||||||
@@ -46,6 +47,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"`
|
||||||
@@ -319,6 +321,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
|
||||||
@@ -458,6 +462,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
|
||||||
|
|||||||
Reference in New Issue
Block a user