test callback
This commit is contained in:
parent
64e4921a96
commit
70ea651bd1
3
def.go
3
def.go
@ -17,6 +17,8 @@ type TGCommand struct {
|
|||||||
Document tb.Document `json:"document"`
|
Document tb.Document `json:"document"`
|
||||||
ParseMode int64 `json:"parse_mode"`
|
ParseMode int64 `json:"parse_mode"`
|
||||||
Delay time.Duration `json:"delay"`
|
Delay time.Duration `json:"delay"`
|
||||||
|
CallbackName string `json:"callback_name"`
|
||||||
|
CallbackData []byte `json:"callback_data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatWarsCallback struct {
|
type ChatWarsCallback struct {
|
||||||
@ -50,6 +52,7 @@ const (
|
|||||||
commandDeleteMsg = 4
|
commandDeleteMsg = 4
|
||||||
commandRefreshMsg = 5
|
commandRefreshMsg = 5
|
||||||
commandSendDocument = 6
|
commandSendDocument = 6
|
||||||
|
commandCallback = 7
|
||||||
|
|
||||||
cmdParseModePlain = 1
|
cmdParseModePlain = 1
|
||||||
cmdParseModeMarkDown = 2
|
cmdParseModeMarkDown = 2
|
||||||
|
10
td.go
10
td.go
@ -295,8 +295,16 @@ func clientMsg(c *tdlib.Client, m TGCommand) {
|
|||||||
|
|
||||||
MQCWMsgQueue <- r
|
MQCWMsgQueue <- r
|
||||||
}
|
}
|
||||||
|
case commandCallback:
|
||||||
|
p := CallbackQueryPayloadData{
|
||||||
|
Data: m.CallbackData,
|
||||||
|
}
|
||||||
|
a, err := c.GetCallbackQueryAnswer(m.FromChatID64, m.FromMsgID64, p)
|
||||||
|
logOnError(err, "clientMsg : GetCallbackQueryAnswer")
|
||||||
|
b, _ := json.Marshal(a)
|
||||||
|
log.Printf("GetCallbackQueryAnswer :\n%s\n", string(b))
|
||||||
default:
|
default:
|
||||||
log.Printf("ListenMQ : No handler for command %d.\n", m.Type)
|
log.Printf("clientMsg : No handler for command %d.\n", m.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user