go-telegram-bot-api/telegram-bot-api

how to send message with image

hyahm opened this issue · 2 comments

hyahm commented

how to send message with image
like this
image

secondMessageText := "test msg"

photoPath := "./img.jpg"
photoMsg := tgbotapi.NewPhoto(chatID, tgbotapi.FilePath(photoPath))
photoMsg.Caption = secondMessageText

if _, err := bot.Send(photoMsg); err != nil {
log.Printf("Error sending photo: %v", err)
}

hyahm commented

Thanks