Добавлена поддержка поля threadid
This commit is contained in:
@@ -27,6 +27,7 @@ type rMsg struct {
|
||||
From string `json:"from,omitempty"`
|
||||
ChatID string `json:"chatid,omitempty"`
|
||||
UserID string `json:"userid,omitempty"`
|
||||
ThreadID string `json:"threadid"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Plugin string `json:"plugin,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
@@ -46,6 +47,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"`
|
||||
@@ -319,6 +321,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
|
||||
@@ -458,6 +462,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
|
||||
|
||||
Reference in New Issue
Block a user