This commit is contained in:
shoopea 2019-06-11 09:49:16 +08:00
parent 9ae3c17cbd
commit 4ec1eb5f9b
2 changed files with 20 additions and 12 deletions

7
def.go
View File

@ -12,6 +12,8 @@ type TGCommand struct {
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 {
@ -36,4 +38,9 @@ const (
commandSendMsg = 3
commandDeleteMsg = 4
commandRefreshMsg = 5
commandSendDocument = 6
cmdParseModePlain = 1
cmdParseModeMarkDown = 2
cmdParseModeHTML = 3
)

1
td.go
View File

@ -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