test
This commit is contained in:
parent
8c1cb7713a
commit
470291f764
2
def.go
2
def.go
@ -21,7 +21,7 @@ type TGCommand struct {
|
|||||||
|
|
||||||
type ChatWarsCallback struct {
|
type ChatWarsCallback struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Data string `json:"data"`
|
Data []byte `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatWarsMessage struct {
|
type ChatWarsMessage struct {
|
||||||
|
8
td.go
8
td.go
@ -77,7 +77,13 @@ func ListenTG(c *tdlib.Client) {
|
|||||||
rm := updateMsg.Message.ReplyMarkup.(*tdlib.ReplyMarkupInlineKeyboard)
|
rm := updateMsg.Message.ReplyMarkup.(*tdlib.ReplyMarkupInlineKeyboard)
|
||||||
for k1, v1 := range rm.Rows {
|
for k1, v1 := range rm.Rows {
|
||||||
for k2, v2 := range v1 {
|
for k2, v2 := range v1 {
|
||||||
fmt.Printf("ReplyMarkupInlineKeyboard[%d][%d][%s] : %s\n", k1, k2, v2.Type.GetInlineKeyboardButtonTypeEnum(), v2.Text)
|
if v2.Type.GetInlineKeyboardButtonTypeEnum() == tdlib.InlineKeyboardButtonTypeCallbackType {
|
||||||
|
cwcb := ChatWarsCallback{
|
||||||
|
Name: v2.Text,
|
||||||
|
Data: v2.(*tdlib.InlineKeyboardButtonTypeCallback).Data,
|
||||||
|
}
|
||||||
|
fmt.Printf("ReplyMarkupInlineKeyboard : %s => %s\n", cwcb.Name, string(cwcb.Data))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user