test
This commit is contained in:
parent
9ae3c17cbd
commit
4ec1eb5f9b
31
def.go
31
def.go
@ -5,13 +5,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type TGCommand struct {
|
type TGCommand struct {
|
||||||
Type int64 `json:"type"`
|
Type int64 `json:"type"`
|
||||||
FromChatID64 int64 `json:"from_chat_id"`
|
FromChatID64 int64 `json:"from_chat_id"`
|
||||||
FromUserID64 int64 `json:"from_user_id"`
|
FromUserID64 int64 `json:"from_user_id"`
|
||||||
FromMsgID64 int64 `json:"from_msg_id"`
|
FromMsgID64 int64 `json:"from_msg_id"`
|
||||||
ToChatID64 int64 `json:"to_chat_id"`
|
ToChatID64 int64 `json:"to_chat_id"`
|
||||||
ToUserID64 int64 `json:"to_user_id"`
|
ToUserID64 int64 `json:"to_user_id"`
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
|
Document tb.Document `json:"document"`
|
||||||
|
ParseMode int64 `json:"parse_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatWarsMessage struct {
|
type ChatWarsMessage struct {
|
||||||
@ -31,9 +33,14 @@ type MQKeepAlive struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
commandForwardMsg = 1
|
commandForwardMsg = 1
|
||||||
commandReplyMsg = 2
|
commandReplyMsg = 2
|
||||||
commandSendMsg = 3
|
commandSendMsg = 3
|
||||||
commandDeleteMsg = 4
|
commandDeleteMsg = 4
|
||||||
commandRefreshMsg = 5
|
commandRefreshMsg = 5
|
||||||
|
commandSendDocument = 6
|
||||||
|
|
||||||
|
cmdParseModePlain = 1
|
||||||
|
cmdParseModeMarkDown = 2
|
||||||
|
cmdParseModeHTML = 3
|
||||||
)
|
)
|
||||||
|
1
td.go
1
td.go
@ -48,6 +48,7 @@ func ListenMQ(c *tdlib.Client, msgs <-chan TGCommand) {
|
|||||||
case commandRefreshMsg:
|
case commandRefreshMsg:
|
||||||
u, err := c.GetMessage(m.FromChatID64, m.FromMsgID64)
|
u, err := c.GetMessage(m.FromChatID64, m.FromMsgID64)
|
||||||
logOnError(err, "ListenMQ : commandRefreshMsg")
|
logOnError(err, "ListenMQ : commandRefreshMsg")
|
||||||
|
log.Printf("ListenMQ : commandRefreshMsg (%d - %d)\n", m.FromChatID64, m.FromMsgID64)
|
||||||
if err != nil && u.Content.GetMessageContentEnum() == tdlib.MessageTextType {
|
if err != nil && u.Content.GetMessageContentEnum() == tdlib.MessageTextType {
|
||||||
txt := u.Content.(*tdlib.MessageText).Text.Text
|
txt := u.Content.(*tdlib.MessageText).Text.Text
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user