Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.groupadministration;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -37,8 +38,10 @@ public class SetChatPhoto extends PartialBotApiMethod<Boolean> {
public static final String PHOTO_FIELD = "photo";

@NonNull
@JsonProperty(CHATID_FIELD)
private String chatId; ///< Unique identifier for the target chat or username of the target channel (in the format @channelusername)
@NonNull
@JsonProperty(PHOTO_FIELD)
private InputFile photo; ///< New chat photo as InputStream, uploaded using multipart/form-data

@Tolerate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -59,8 +60,10 @@ public class SendAnimation extends SendMediaBotMethod<Message> {
public static final String HASSPOILER_FIELD = "has_spoiler";
public static final String REPLY_PARAMETERS_FIELD = "reply_parameters";

@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
@JsonProperty(MESSAGETHREADID_FIELD)
private Integer messageThreadId;

/**
Expand All @@ -72,15 +75,24 @@ public class SendAnimation extends SendMediaBotMethod<Message> {
* Unique identifier for the target message thread (topic) of the forum;
* for forum supergroups only
*/
@JsonProperty(ANIMATION_FIELD)
@NonNull
private InputFile animation;
@JsonProperty(DURATION_FIELD)
private Integer duration; ///< Optional. Duration of sent animation in seconds
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Animation caption (may also be used when resending videos by file_id).
@JsonProperty(WIDTH_FIELD)
private Integer width; ///< Optional. Animation width
@JsonProperty(HEIGHT_FIELD)
private Integer height; ///< Optional. Animation height
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
@JsonProperty(REPLYTOMESSAGEID_FIELD)
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
@JsonProperty(REPLYMARKUP_FIELD)
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
/**
* Optional.
Expand All @@ -90,20 +102,26 @@ public class SendAnimation extends SendMediaBotMethod<Message> {
* Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>”
* if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
*/
@JsonProperty(THUMBNAIL_FIELD)
private InputFile thumbnail;
@JsonProperty(CAPTION_ENTITIES_FIELD)
@Singular
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving
/**
* Optional.
* Pass True if the animation must be covered with a spoiler animation
*/
@JsonProperty(HASSPOILER_FIELD)
private Boolean hasSpoiler;
/**
* Optional
* Description of the message to reply to
*/
@JsonProperty(REPLY_PARAMETERS_FIELD)
private ReplyParameters replyParameters;

@Tolerate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -60,21 +61,32 @@ public class SendAudio extends SendMediaBotMethod<Message> {
public static final String REPLY_PARAMETERS_FIELD = "reply_parameters";

@NonNull
@JsonProperty(CHATID_FIELD)
private String chatId; ///< Unique identifier for the chat to send the message to (or Username fro channels)
/**
* Unique identifier for the target message thread (topic) of the forum;
* for forum supergroups only
*/
@JsonProperty(MESSAGETHREADID_FIELD)
private Integer messageThreadId;
@NonNull
@JsonProperty(AUDIO_FIELD)
private InputFile audio; ///< Audio file to send. file_id as String to resend an audio that is already on the Telegram servers or Url to upload it
@JsonProperty(REPLYTOMESSAGEID_FIELD)
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
@JsonProperty(REPLYMARKUP_FIELD)
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(PERFOMER_FIELD)
private String performer; ///< Optional. Performer of sent audio
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title of sent audio
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
@JsonProperty(DURATION_FIELD)
private Integer duration; ///< Integer Duration of the audio in seconds as defined by sender
/**
* Optional.
Expand All @@ -84,15 +96,20 @@ public class SendAudio extends SendMediaBotMethod<Message> {
* Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass
* “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
*/
@JsonProperty(THUMBNAIL_FIELD)
private InputFile thumbnail;
@Singular
@JsonProperty(CAPTION_ENTITIES_FIELD)
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving
/**
* Optional
* Description of the message to reply to
*/
@JsonProperty(REPLY_PARAMETERS_FIELD)
private ReplyParameters replyParameters;

@Tolerate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -53,19 +54,27 @@ public class SendDocument extends SendMediaBotMethod<Message> {
public static final String PROTECTCONTENT_FIELD = "protect_content";
public static final String REPLY_PARAMETERS_FIELD = "reply_parameters";

@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to or Username for the channel to send the message to
/**
* Unique identifier for the target message thread (topic) of the forum;
* for forum supergroups only
*/
@JsonProperty(MESSAGETHREADID_FIELD)
private Integer messageThreadId;
@JsonProperty(DOCUMENT_FIELD)
@NonNull
private InputFile document; ///< File file to send. file_id as String to resend a file that is already on the Telegram servers or Url to upload it
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Document caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
@JsonProperty(REPLYTOMESSAGEID_FIELD)
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
@JsonProperty(REPLYMARKUP_FIELD)
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
/**
* Optional.
Expand All @@ -75,11 +84,16 @@ public class SendDocument extends SendMediaBotMethod<Message> {
* Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>”
* if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
*/
@JsonProperty(THUMBNAIL_FIELD)
private InputFile thumbnail;
@JsonProperty(CAPTION_ENTITIES_FIELD)
@Singular
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(DISABLECONTENTTYPEDETECTION_FIELD)
private Boolean disableContentTypeDetection; ///< Optional Disables automatic server-side content type detection for files uploaded using multipart/form-data
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving
/**
* Optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -52,18 +53,25 @@ public class SendMediaGroup extends PartialBotApiMethod<ArrayList<Message>> {
public static final String PROTECTCONTENT_FIELD = "protect_content";
public static final String REPLY_PARAMETERS_FIELD = "reply_parameters";

@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the target chat or username of the target channel (in the format @channelusername)
/**
* Unique identifier for the target message thread (topic) of the forum;
* for forum supergroups only
*/
@JsonProperty(MESSAGETHREADID_FIELD)
private Integer messageThreadId;
@JsonProperty(MEDIA_FIELD)
@NonNull
private List<InputMedia> medias; ///< A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
@JsonProperty(REPLYTOMESSAGEID_FIELD)
private Integer replyToMessageId; ///< Optional. If the messages are a reply, ID of the original message
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification; ///< Optional. Sends the messages silently. Users will receive a notification with no sound.
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving
/**
* Optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -53,28 +54,40 @@ public class SendPhoto extends SendMediaBotMethod<Message> {
public static final String REPLY_PARAMETERS_FIELD = "reply_parameters";


@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
/**
* Unique identifier for the target message thread (topic) of the forum;
* for forum supergroups only
*/
@JsonProperty(MESSAGETHREADID_FIELD)
private Integer messageThreadId;
@JsonProperty(PHOTO_FIELD)
@NonNull
private InputFile photo; ///< Photo to send. file_id as String to resend a photo that is already on the Telegram servers or URL to upload it
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional Photo caption (may also be used when resending photos by file_id).
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
@JsonProperty(REPLYTOMESSAGEID_FIELD)
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
@JsonProperty(REPLYMARKUP_FIELD)
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
@JsonProperty(CAPTION_ENTITIES_FIELD)
@Singular
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving
/**
* Optional.
* Pass True if the photo must be covered with a spoiler animation
*/
@JsonProperty(HASSPOILER_FIELD)
private Boolean hasSpoiler;
/**
* Optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -45,12 +46,14 @@ public class SendSticker extends SendMediaBotMethod<Message> {
public static final String EMOJI_FIELD = "emoji";
public static final String REPLY_PARAMETERS_FIELD = "reply_parameters";

@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
/**
* Unique identifier for the target message thread (topic) of the forum;
* for forum supergroups only
*/
@JsonProperty(MESSAGETHREADID_FIELD)
private Integer messageThreadId;
/**
* Sticker to send.
Expand All @@ -60,17 +63,24 @@ public class SendSticker extends SendMediaBotMethod<Message> {
* Video stickers can only be sent by a file_id.
* Animated stickers can't be sent via an HTTP URL.
*/
@JsonProperty(STICKER_FIELD)
@NonNull
private InputFile sticker; ///< Sticker file to send. file_id as String to resend a sticker that is already on the Telegram servers or URL to upload it
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
@JsonProperty(REPLYTOMESSAGEID_FIELD)
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
@JsonProperty(REPLYMARKUP_FIELD)
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving
/**
* Optional
* Emoji associated with the sticker; only for uploaded stickers
*/
@JsonProperty(EMOJI_FIELD)
private String emoji;
/**
* Optional
Expand Down
Loading