Fix example
This commit is contained in:
parent
7a749a3d0c
commit
ee63b08bd7
2 changed files with 4 additions and 5 deletions
|
@ -42,7 +42,7 @@ func main() {
|
||||||
AddCallback("Картинка", schemes.POSITIVE, "picture")
|
AddCallback("Картинка", schemes.POSITIVE, "picture")
|
||||||
|
|
||||||
// Отправка сообщения с клавиатурой
|
// Отправка сообщения с клавиатурой
|
||||||
err := api.Messages.Send(tamtam.NewMessage().SetUser(upd.Message.Sender.UserId).AddKeyboard(keyboard))
|
err := api.Messages.Send(tamtam.NewMessage().SetUser(upd.Message.Recipient.UserId).AddKeyboard(keyboard).SetText("Привет!"))
|
||||||
log.Printf("Answer: %#v", err)
|
log.Printf("Answer: %#v", err)
|
||||||
case *schemes.MessageCallbackUpdate:
|
case *schemes.MessageCallbackUpdate:
|
||||||
// Ответ на коллбек
|
// Ответ на коллбек
|
||||||
|
@ -51,7 +51,8 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if err := api.Messages.Send(tamtam.NewMessage().SetUser(upd.Message.Sender.UserId).AddPhoto(photo)); err != nil {
|
msg := tamtam.NewMessage().SetUser(upd.Message.Recipient.UserId).AddPhoto(photo)
|
||||||
|
if err := api.Messages.Send(msg); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,6 @@ type ButtonInterface interface {
|
||||||
|
|
||||||
// Send this object when your bots wants to react to when a button is pressed
|
// Send this object when your bots wants to react to when a button is pressed
|
||||||
type CallbackAnswer struct {
|
type CallbackAnswer struct {
|
||||||
UserId int64 `json:"user_id,omitempty"`
|
|
||||||
Message *NewMessageBody `json:"message,omitempty"` // Fill this if you want to modify current message
|
Message *NewMessageBody `json:"message,omitempty"` // Fill this if you want to modify current message
|
||||||
Notification string `json:"notification,omitempty"` // Fill this if you just want to send one-time notification to user
|
Notification string `json:"notification,omitempty"` // Fill this if you just want to send one-time notification to user
|
||||||
}
|
}
|
||||||
|
@ -272,7 +271,6 @@ type Image struct {
|
||||||
// Buttons in messages
|
// Buttons in messages
|
||||||
type InlineKeyboardAttachment struct {
|
type InlineKeyboardAttachment struct {
|
||||||
Attachment
|
Attachment
|
||||||
CallbackId string `json:"callback_id"` // Unique identifier of keyboard
|
|
||||||
Payload Keyboard `json:"payload"`
|
Payload Keyboard `json:"payload"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue