direction
This commit is contained in:
parent
01a786d015
commit
0a49c2a26b
18
main.go
18
main.go
@ -16,16 +16,16 @@ import (
|
||||
type MsgDirection string
|
||||
|
||||
const (
|
||||
Incoming MsgDirection = `incoming`
|
||||
Outgoing MsgDirection = `outgoing`
|
||||
MsgIncoming string = `incoming`
|
||||
MsgOutgoing string = `outgoing`
|
||||
)
|
||||
|
||||
type ChatWarsMessage struct {
|
||||
MsgID64 int64 `json:"msg_id"`
|
||||
UserID64 int64 `json:"user_id"`
|
||||
Direction MsgDirection `json:"direction"`
|
||||
MsgText string `json:"msg"`
|
||||
MsgDate int32 `json:"date"`
|
||||
MsgID64 int64 `json:"msg_id"`
|
||||
UserID64 int64 `json:"user_id"`
|
||||
Direction string `json:"direction"`
|
||||
MsgText string `json:"msg"`
|
||||
MsgDate int32 `json:"date"`
|
||||
}
|
||||
|
||||
const user_chtwrsbot = 408101137
|
||||
@ -180,9 +180,9 @@ func ListenCW(c *tdlib.Client) {
|
||||
MsgID64: updateMsg.Message.ID,
|
||||
}
|
||||
if senderUserID == ownUserID32 {
|
||||
m.Direction = Outgoing
|
||||
m.Direction = MsgOutgoing
|
||||
} else {
|
||||
m.Direction = Incoming
|
||||
m.Direction = MsgIncoming
|
||||
}
|
||||
|
||||
b, err := json.Marshal(m)
|
||||
|
Loading…
Reference in New Issue
Block a user