send photo function
authorEduardo <[email protected]>
Thu, 28 Mar 2024 02:34:09 +0000 (03:34 +0100)
committerEduardo <[email protected]>
Thu, 28 Mar 2024 02:34:09 +0000 (03:34 +0100)
bot.go

diff --git a/bot.go b/bot.go
index 7526a295c34b96e69aef76de94ade94d5ec9d692..31717cfa479c8c901485a5d8c7d211981da21076 100644 (file)
--- 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