Closed brankovitorovic closed 5 months ago
Released v1.0.1
with fix.
Now
b.SendMessage(ctx, &bot.SendMessageParams{
ChatID: update.Message.Chat.ID,
Text: "Hello, https://pinterest.com",
LinkPreviewOptions: &models.LinkPreviewOptions{
IsDisabled: bot.False(),
},
})
works correctly
Thanks so much for a quick fix. Wish you the best.
In the previous version, I used
DisableWebPagePreview: true
when creatingSendMessageParam
. and it worked great. Now, with the new version this is replaced withLinkPreviewOptions
and when I add&models.LinkPreviewOptions{IsDisabled: &linkPreviewDisabled}
I got message{"ok":false,"error_code":400,"description":"Bad Request: field \"url\" must be of type String"}
. So I added random text like thisLinkPreviewOptions: &models.LinkPreviewOptions{URL: &testURL, IsDisabled: &linkPreviewDisabled},
and it worked.The problem is why I need to specify some URLs and set them here when I want to disable URL previews. Is there an option to add a check if
IsDisabled=true
then no URL is required?