From eb865afb96de93c658ebb8f2f006818a12fe9d98 Mon Sep 17 00:00:00 2001 From: eleksir Date: Sun, 10 Apr 2022 00:15:25 +0300 Subject: [PATCH] =?UTF-8?q?chatid=20=D0=B8=20userid=20=D0=B2=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=89=D0=B5=D0=BC=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B5?= =?UTF-8?q?=20-=20=D1=8D=D1=82=D0=BE=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 7002e70..e2c0bb7 100644 --- a/main.go +++ b/main.go @@ -35,8 +35,8 @@ type myConfig struct { // Входящее сообщение из pubsub-канала redis-ки type rMsg struct { From string `json:"from,omitempty"` - Chatid int64 `json:"chatid,omitempty"` - Userid int64 `json:"userid,omitempty"` + Chatid string `json:"chatid,omitempty"` + Userid string `json:"userid,omitempty"` Message string `json:"message,omitempty"` Plugin string `json:"plugin,omitempty"` Mode string `json:"mode,omitempty"` @@ -54,8 +54,8 @@ type rMsg struct { // Исходящее сообщение в pubsub-канал redis-ки type sMsg struct { From string `json:"from"` - Chatid int64 `json:"chatid"` - Userid int64 `json:"userid"` + Chatid string `json:"chatid"` + Userid string `json:"userid"` Message string `json:"message"` Plugin string `json:"plugin"` Mode string `json:"mode"` @@ -97,12 +97,12 @@ func msgParser(ctx context.Context, msg string) { return } - if exist := j.Chatid; exist == 0 { + if exist := j.Chatid; exist == "" { log.Warnf("Incorrect msg from redis, no chatid field: %s", msg) return } - if exist := j.Userid; exist == 0 { + if exist := j.Userid; exist == "" { log.Warnf("Incorrect msg from redis, no userid field: %s", msg) return }