From: Eduardo Date: Thu, 28 Mar 2024 02:34:09 +0000 (+0100) Subject: send photo function X-Git-Url: http://git.edufdez.es/?a=commitdiff_plain;h=f771c939d373911407ba791e3c0603b8b08dcea5;p=sylphiette-bot.git send photo function --- 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