diff --git a/def.go b/def.go index 7943079..0312a72 100644 --- a/def.go +++ b/def.go @@ -5,13 +5,15 @@ import ( ) type TGCommand struct { - Type int64 `json:"type"` - FromChatID64 int64 `json:"from_chat_id"` - FromUserID64 int64 `json:"from_user_id"` - FromMsgID64 int64 `json:"from_msg_id"` - ToChatID64 int64 `json:"to_chat_id"` - ToUserID64 int64 `json:"to_user_id"` - Text string `json:"text"` + Type int64 `json:"type"` + FromChatID64 int64 `json:"from_chat_id"` + FromUserID64 int64 `json:"from_user_id"` + FromMsgID64 int64 `json:"from_msg_id"` + ToChatID64 int64 `json:"to_chat_id"` + ToUserID64 int64 `json:"to_user_id"` + Text string `json:"text"` + Document tb.Document `json:"document"` + ParseMode int64 `json:"parse_mode"` } type ChatWarsMessage struct { @@ -31,9 +33,14 @@ type MQKeepAlive struct { } const ( - commandForwardMsg = 1 - commandReplyMsg = 2 - commandSendMsg = 3 - commandDeleteMsg = 4 - commandRefreshMsg = 5 + commandForwardMsg = 1 + commandReplyMsg = 2 + commandSendMsg = 3 + commandDeleteMsg = 4 + commandRefreshMsg = 5 + commandSendDocument = 6 + + cmdParseModePlain = 1 + cmdParseModeMarkDown = 2 + cmdParseModeHTML = 3 ) diff --git a/td.go b/td.go index 18fd424..28f07ac 100644 --- a/td.go +++ b/td.go @@ -48,6 +48,7 @@ func ListenMQ(c *tdlib.Client, msgs <-chan TGCommand) { case commandRefreshMsg: u, err := c.GetMessage(m.FromChatID64, m.FromMsgID64) logOnError(err, "ListenMQ : commandRefreshMsg") + log.Printf("ListenMQ : commandRefreshMsg (%d - %d)\n", m.FromChatID64, m.FromMsgID64) if err != nil && u.Content.GetMessageContentEnum() == tdlib.MessageTextType { txt := u.Content.(*tdlib.MessageText).Text.Text