This commit is contained in:
shoopea 2019-05-03 15:24:09 +08:00
parent d568ef94cd
commit 01a786d015

View File

@ -13,11 +13,11 @@ import (
"github.com/streadway/amqp" "github.com/streadway/amqp"
) )
type MsgDirection int type MsgDirection string
const ( const (
Incoming MsgDirection = 1 Incoming MsgDirection = `incoming`
Outgoing MsgDirection = 2 Outgoing MsgDirection = `outgoing`
) )
type ChatWarsMessage struct { type ChatWarsMessage struct {
@ -25,6 +25,7 @@ type ChatWarsMessage struct {
UserID64 int64 `json:"user_id"` UserID64 int64 `json:"user_id"`
Direction MsgDirection `json:"direction"` Direction MsgDirection `json:"direction"`
MsgText string `json:"msg"` MsgText string `json:"msg"`
MsgDate int32 `json:"date"`
} }
const user_chtwrsbot = 408101137 const user_chtwrsbot = 408101137
@ -174,6 +175,7 @@ func ListenCW(c *tdlib.Client) {
m := ChatWarsMessage{ m := ChatWarsMessage{
UserID64: ownUserID64, UserID64: ownUserID64,
MsgDate: updateMsg.Message.Date,
MsgText: string(txt), MsgText: string(txt),
MsgID64: updateMsg.Message.ID, MsgID64: updateMsg.Message.ID,
} }
@ -200,6 +202,7 @@ func ListenCW(c *tdlib.Client) {
fmt.Println(txt, "\n") fmt.Println(txt, "\n")
fmt.Println("************ DETAILS ************") fmt.Println("************ DETAILS ************")
fmt.Println("ID : ", updateMsg.Message.ID) fmt.Println("ID : ", updateMsg.Message.ID)
fmt.Println("Date : ", updateMsg.Message.Date)
fmt.Println("SenderUserID : ", updateMsg.Message.SenderUserID) fmt.Println("SenderUserID : ", updateMsg.Message.SenderUserID)
fmt.Println("ChatID : ", updateMsg.Message.ChatID) fmt.Println("ChatID : ", updateMsg.Message.ChatID)
fmt.Println("SendingState : ", updateMsg.Message.SendingState) fmt.Println("SendingState : ", updateMsg.Message.SendingState)