Skip to content

Commit e2d0031

Browse files
committed
Deprecate hideUrl method in InlineQueryResultArticle
1 parent b36bdba commit e2d0031

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

library/src/main/java/com/pengrad/telegrambot/model/request/InlineQueryResultArticle.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ public InlineQueryResultArticle url(String url) {
3434
return this;
3535
}
3636

37+
/**
38+
* @deprecated hideUrl method is removed since <a href="https://core.telegram.org/bots/api#january-1-2025">Bot API 8.2</a>. This method removes url parameter to emulate hideUrl parameter behavior. It may break your code logic. Pass an empty string as url instead.
39+
*/
40+
@Deprecated
3741
public InlineQueryResultArticle hideUrl(Boolean hideUrl) {
38-
this.hide_url = hideUrl;
42+
this.url = null;
3943
return this;
4044
}
4145

library/src/test/java/com/pengrad/telegrambot/TelegramBotTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public void answerInline() {
354354
new InputTextMessageContent("message")
355355
.entities(new MessageEntity(MessageEntity.Type.bold, 0, 2))
356356
.disableWebPagePreview(false).parseMode(ParseMode.HTML))
357-
.url(someUrl).hideUrl(true).description("desc")
357+
.url(someUrl).description("desc")
358358
.thumbUrl(someUrl).thumbHeight(100).thumbWidth(100),
359359
new InlineQueryResultArticle("2", "title",
360360
new InputContactMessageContent("123123123", "na,e").lastName("lastName").vcard("qr vcard")),

0 commit comments

Comments
 (0)