Compare commits

..

No commits in common. "d179d759c958dbb8499a19e6663014fe370e5b29" and "6bc45babc5b3ca306ffe4cf60bb8308ce0043206" have entirely different histories.

2 changed files with 3 additions and 9 deletions

3
.gitignore vendored
View File

@ -1,3 +0,0 @@
.env
**.jpg
**.db

View File

@ -139,12 +139,9 @@ func main() {
msg.ReplyMarkup = kbd msg.ReplyMarkup = kbd
bc.bot.Send(msg) bc.bot.Send(msg)
} else { } else {
filename := "./" + img + ".jpg" url, _ := bc.bot.GetFileDirectURL(img)
if _, err := os.Stat(filename); errors.Is(err, os.ErrNotExist) { DownloadFile("./preview.jpg", url)
url, _ := bc.bot.GetFileDirectURL(img) msg := tgbotapi.NewPhoto(update.Message.Chat.ID, tgbotapi.FilePath("./preview.jpg"))
DownloadFile(filename, url)
}
msg := tgbotapi.NewPhoto(update.Message.Chat.ID, tgbotapi.FilePath(filename))
msg.Caption = bc.GetBotContent("start") msg.Caption = bc.GetBotContent("start")
msg.ReplyMarkup = kbd msg.ReplyMarkup = kbd
bc.bot.Send(msg) bc.bot.Send(msg)