diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java index c9b6444c..649906ca 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java @@ -130,12 +130,14 @@ public class SendAudio { return disableNotification; } - public void enableNotification() { + public SendAudio enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendAudio disableNotification() { this.disableNotification = true; + return this; } public boolean isNewAudio() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java index b3eaf39a..3fd86098 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java @@ -72,12 +72,14 @@ public class SendContact extends BotApiMethod { return disableNotification; } - public void enableNotification() { + public SendContact enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendContact disableNotification() { this.disableNotification = true; + return this; } public String getPhoneNumber() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java index 5a552d0d..dacf2bb2 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java @@ -82,12 +82,14 @@ public class SendDocument { return disableNotification; } - public void enableNotification() { + public SendDocument enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendDocument disableNotification() { this.disableNotification = true; + return this; } public String getCaption() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java index 42098638..a9d2ee45 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java @@ -87,12 +87,14 @@ public class SendLocation extends BotApiMethod { return disableNotification; } - public void enableNotification() { + public SendLocation enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendLocation disableNotification() { this.disableNotification = true; + return this; } @Override diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java index f0488644..722b8f2a 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java @@ -89,36 +89,42 @@ public class SendMessage extends BotApiMethod { return disableNotification; } - public void disableWebPagePreview() { + public SendMessage disableWebPagePreview() { disableWebPagePreview = true; + return this; } - public void enableWebPagePreview() { + public SendMessage enableWebPagePreview() { disableWebPagePreview = null; + return this; } - public void enableNotification() { + public SendMessage enableNotification() { this.disableNotification = null; + return this; } - public void disableNotification() { + public SendMessage disableNotification() { this.disableNotification = true; + return this; } - public void enableMarkdown(boolean enable) { + public SendMessage enableMarkdown(boolean enable) { if (enable) { this.parseMode = ParseMode.MARKDOWN; } else { this.parseMode = null; } + return this; } - public void enableHtml(boolean enable) { + public SendMessage enableHtml(boolean enable) { if (enable) { this.parseMode = ParseMode.HTML; } else { this.parseMode = null; } + return this; } @Override diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java index 3bb8536a..e1059aa0 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java @@ -94,12 +94,14 @@ public class SendPhoto { return disableNotification; } - public void enableNotification() { + public SendPhoto enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendPhoto disableNotification() { this.disableNotification = true; + return this; } public SendPhoto setNewPhoto(String photo, String photoName) { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java index 3a08f29b..b9c9cd9a 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java @@ -81,12 +81,14 @@ public class SendSticker { return disableNotification; } - public void enableNotification() { + public SendSticker enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendSticker disableNotification() { this.disableNotification = true; + return this; } public boolean isNewSticker() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java index c3ac39c6..a2512132 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java @@ -94,12 +94,14 @@ public class SendVenue extends BotApiMethod { return disableNotification; } - public void enableNotification() { + public SendVenue enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendVenue disableNotification() { this.disableNotification = true; + return this; } public String getTitle() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java index e1da970f..135ad939 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java @@ -109,12 +109,14 @@ public class SendVideo { return disableNotification; } - public void enableNotification() { + public SendVideo enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendVideo disableNotification() { this.disableNotification = true; + return this; } public Integer getWidth() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java index 6095b938..fb01b1ea 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java @@ -52,12 +52,14 @@ public class SendVoice { return disableNotification; } - public void enableNotification() { + public SendVoice enableNotification() { this.disableNotification = false; + return this; } - public void disableNotification() { + public SendVoice disableNotification() { this.disableNotification = true; + return this; } public String getChatId() { diff --git a/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageText.java b/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageText.java index 1d2d470f..3beb6823 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageText.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageText.java @@ -105,28 +105,32 @@ public class EditMessageText extends BotApiMethod { return this; } - public void disableWebPagePreview() { + public EditMessageText disableWebPagePreview() { disableWebPagePreview = true; + return this; } - public void enableWebPagePreview() { + public EditMessageText enableWebPagePreview() { disableWebPagePreview = null; + return this; } - public void enableMarkdown(boolean enable) { + public EditMessageText enableMarkdown(boolean enable) { if (enable) { this.parseMode = ParseMode.MARKDOWN; } else { this.parseMode = null; } + return this; } - public void enableHtml(boolean enable) { + public EditMessageText enableHtml(boolean enable) { if (enable) { this.parseMode = ParseMode.HTML; } else { this.parseMode = null; } + return this; } @Override