From f771c939d373911407ba791e3c0603b8b08dcea5 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Thu, 28 Mar 2024 03:34:09 +0100 Subject: [PATCH] send photo function --- bot.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot.go b/bot.go index 7526a29..31717cf 100644 --- a/bot.go +++ b/bot.go @@ -201,6 +201,13 @@ func sendTelegramMessage(chatId int64, text string) error { _, err := telegram.Send(msg) return err } +func sendTelegramPhoto(chatId int64, photo string, text string) error { + msg := tgbotapi.NewPhoto(chatId, tgbotapi.FileURL(photo)) + msg.ParseMode = tgbotapi.ModeHTML + msg.Caption = text + _, err := telegram.Send(msg) + return err +} func handleButton(query *tgbotapi.CallbackQuery) { var text string -- 2.30.2