Skip to content

Commit

Permalink
Merge pull request rubenlagus#1143 from AminevRamil/dev
Browse files Browse the repository at this point in the history
Reworked some of the old comments in javadoc style
  • Loading branch information
rubenlagus authored Nov 7, 2022
2 parents 64388f4 + 76f5cb2 commit 4db7532
Show file tree
Hide file tree
Showing 48 changed files with 1,319 additions and 356 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ public class SendDice extends BotApiMethodMessage {
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String PROTECTCONTENT_FIELD = "protect_content";

/**
* Unique identifier for the target chat or username of the target channel (in the format @channelusername)
*/
@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the target chat or username of the target channel (in the format @channelusername)
private String chatId;
/**
* Optional.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
* This object represents an audio file
* @author Ruben Bermudez
* @version 1.0
* This object represents an audio file
*/
@EqualsAndHashCode(callSuper = false)
@Getter
Expand All @@ -32,18 +32,28 @@ public class Audio implements BotApiObject {
private static final String THUMB_FIELD = "thumb";
private static final String FILENAME_FIELD = "file_name";

/**
* Identifier for this file, which can be used to download or reuse the file
*/
@JsonProperty(FILEID_FIELD)
private String fileId; ///< Identifier for this file, which can be used to download or reuse the file
private String fileId;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots.
* Can't be used to download or reuse the file.
*/
@JsonProperty(FILEUNIQUEID_FIELD)
private String fileUniqueId;
/**
* Integer Duration of the audio in seconds as defined by sender
*/
@JsonProperty(DURATION_FIELD)
private Integer duration; ///< Integer Duration of the audio in seconds as defined by sender
private Integer duration;
/**
* Optional.
* MIME type of the file as defined by sender
*/
@JsonProperty(MIMETYPE_FIELD)
private String mimeType; ///< Optional. MIME type of the file as defined by sender
private String mimeType;
/**
* Optional.
* File size in bytes.
Expand All @@ -52,12 +62,28 @@ public class Audio implements BotApiObject {
*/
@JsonProperty(FILESIZE_FIELD)
private Long fileSize;
/**
* Optional.
* Title of the audio as defined by sender or by audio tags
*/
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title of the audio as defined by sender or by audio tags
private String title;
/**
* Optional.
* Performer of the audio as defined by sender or by audio tags
*/
@JsonProperty(PERFORMER_FIELD)
private String performer; ///< Optional. Performer of the audio as defined by sender or by audio tags
private String performer;
/**
* Optional.
* Thumbnail of the album cover to which the music file belongs
*/
@JsonProperty(THUMB_FIELD)
private PhotoSize thumb; ///< Optional. Thumbnail of the album cover to which the music file belongs
private PhotoSize thumb;
/**
* Optional.
* Original filename as defined by sender
*/
@JsonProperty(FILENAME_FIELD)
private String fileName; ///< Optional. Original filename as defined by sender
private String fileName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
* @author Ruben Bermudez
* @version 1.0
* This object represents an incoming callback query from a
* callback button in an inline keyboard.
* If the button that originated the query was attached to a message sent by the bot,
Expand All @@ -22,6 +20,8 @@
* until you call answerCallbackQuery. It is, therefore, necessary to react by
* calling answerCallbackQuery even if no notification to the user is needed
* (e.g., without specifying any of the optional parameters).
* @author Ruben Bermudez
* @version 1.0
*/
@EqualsAndHashCode(callSuper = false)
@Getter
Expand All @@ -39,10 +39,16 @@ public class CallbackQuery implements BotApiObject {
private static final String GAMESHORTNAME_FIELD = "game_short_name";
private static final String CHAT_INSTANCE_FIELD = "chat_instance";

/**
* Unique identifier for this query
*/
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier for this query
private String id;
/**
* Sender
*/
@JsonProperty(FROM_FIELD)
private User from; ///< Sender
private User from;
/**
* Optional.
* Message with the callback button that originated the query.
Expand All @@ -51,8 +57,12 @@ public class CallbackQuery implements BotApiObject {
*/
@JsonProperty(MESSAGE_FIELD)
private Message message;
/**
* Optional.
* Identifier of the message sent via the bot in inline mode, that originated the query
*/
@JsonProperty(INLINE_MESSAGE_ID_FIELD)
private String inlineMessageId; ///< Optional. Identifier of the message sent via the bot in inline mode, that originated the query
private String inlineMessageId;
/**
*
* Optional. Data associated with the callback button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
* This object represents a Telegram chat with an user or a group
* @author Ruben Bermudez
* @version 6.1
* This object represents a Telegram chat with an user or a group
*/
@SuppressWarnings("WeakerAccess")
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -64,41 +64,92 @@ public class Chat implements BotApiObject {
*/
@JsonProperty(ID_FIELD)
@NonNull
private Long id; ///< Unique identifier for this chat, not exceeding 1e13 by absolute value
private Long id;
/**
* Type of the chat, one of “private”, “group” or “channel” or "supergroup"
*/
@JsonProperty(TYPE_FIELD)
@NonNull
private String type; ///< Type of the chat, one of “private”, “group” or “channel” or "supergroup"
private String type;
/**
* Optional.
* Title of the chat, only for channels and group chat
*/
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title of the chat, only for channels and group chat
private String title;
/**
* Optional
* Username of the chat, only for private chats and channels if available
*/
@JsonProperty(FIRSTNAME_FIELD)
private String firstName; ///< Optional. Username of the chat, only for private chats and channels if available
private String firstName;
/**
* Optional.
* Interlocutor's first name for private chats
*/
@JsonProperty(LASTNAME_FIELD)
private String lastName; ///< Optional. Interlocutor's first name for private chats
private String lastName;
/**
* Optional.
* Interlocutor's last name for private chats
*/
@JsonProperty(USERNAME_FIELD)
private String userName; ///< Optional. Interlocutor's last name for private chats
private String userName;
/**
* Optional.
* Chat photo. Returned only in getChat.
*/
@JsonProperty(PHOTO_FIELD)
private ChatPhoto photo; ///< Optional. Chat photo. Returned only in getChat.
private ChatPhoto photo;
/**
* Optional.
* Description, for groups, supergroups and channel chats. Returned only in getChat.
*/
@JsonProperty(DESCRIPTION_FIELD)
private String description; ///< Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
private String description;
/**
* Optional.
* Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
*/
@JsonProperty(INVITELINK_FIELD)
private String inviteLink; ///< Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
private String inviteLink;
/**
* Optional.
* The most recent pinned message (by sending date). Returned only in getChat.
*/
@JsonProperty(PINNEDMESSAGE_FIELD)
private Message pinnedMessage; ///< Optional. The most recent pinned message (by sending date). Returned only in getChat.
private Message pinnedMessage;
/**
* Optional.
* For supergroups, name of Group sticker set. Returned only in getChat.
*/
@JsonProperty(STICKERSETNAME_FIELD)
private String stickerSetName; ///< Optional. For supergroups, name of Group sticker set. Returned only in getChat.
private String stickerSetName;
/**
* Optional.
* True, if the bot can change group the sticker set. Returned only in getChat.
*/
@JsonProperty(CANSETSTICKERSET_FIELD)
private Boolean canSetStickerSet; ///< Optional. True, if the bot can change group the sticker set. Returned only in getChat.
private Boolean canSetStickerSet;
/**
* Optional.
* Default chat member permissions, for groups and supergroups. Returned only in getChat.
*/
@JsonProperty(PERMISSIONS_FIELD)
private ChatPermissions permissions; ///< Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
private ChatPermissions permissions;
/**
* Optional.
* For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user.
* Returned only in getChat.
*/
@JsonProperty(SLOWMODEDELAY_FIELD)
private Integer slowModeDelay;
/**
* Optional.
* Bio of the other party in a private chat. Returned only in getChat.
*/
@JsonProperty(BIO_FIELD)
private String bio; ///< Optional. Bio of the other party in a private chat. Returned only in getChat.
private String bio;
/**
* Optional.
* Unique identifier for the linked chat,
Expand All @@ -111,10 +162,16 @@ public class Chat implements BotApiObject {
*/
@JsonProperty(LINKEDCHATID_FIELD)
private Long linkedChatId;
/**
* Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
*/
@JsonProperty(LOCATION_FIELD)
private ChatLocation location; ///< Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
private ChatLocation location;
/**
* Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
*/
@JsonProperty(MESSAGEAUTODELETETIME_FIELD)
private Integer messageAutoDeleteTime; ///< Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
private Integer messageAutoDeleteTime;
/**
* Optional.
* True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
* Represents an invite link for a chat.
* @author Ruben Bermudez
* @version 5.1
*
* Represents an invite link for a chat.
*/
@EqualsAndHashCode(callSuper = false)
@Getter
Expand All @@ -38,25 +37,45 @@ public class ChatInviteLink implements BotApiObject {
*/
@JsonProperty(INVITELINK_FIELD)
private String inviteLink;
/**
* Creator of the link
*/
@JsonProperty(CREATOR_FIELD)
private User creator; ///< Creator of the link
private User creator;
/**
* True, if the link is primary
*/
@JsonProperty(ISPRIMARY_FIELD)
private Boolean isPrimary; ///< True, if the link is primary
private Boolean isPrimary;
/**
* True, if the link is revoked
*/
@JsonProperty(ISREVOKED_FIELD)
private Boolean isRevoked; ///< True, if the link is revoked
private Boolean isRevoked;
/**
* Optional.
* Point in time (Unix timestamp) when the link will expire or has been expired
*/
@JsonProperty(EXPIREDATE_FIELD)
private Integer expireDate; ///< Optional. Point in time (Unix timestamp) when the link will expire or has been expired
private Integer expireDate;
/**
* Optional.
*
* Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
*/
@JsonProperty(MEMBERLIMIT_FIELD)
private Integer memberLimit;
/**
* Optional.
* Invite link name
*/
@JsonProperty(NAME_FIELD)
private String name; ///< Optional. Invite link name
private String name;
/**
* Optional.
* Number of pending join requests created using this link
*/
@JsonProperty(PENDINGJOINREQUESTCOUNT_FIELD)
private Integer pendingJoinRequestCount; ///< Optional. Number of pending join requests created using this link
private Integer pendingJoinRequestCount;
/**
* True, if users joining the chat via the link need to be approved by chat administrators
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
* Represents a join request sent to a chat.
* @author Ruben Bermudez
* @version 5.4
*
* Represents a join request sent to a chat.
*/
@EqualsAndHashCode(callSuper = false)
@Getter
Expand All @@ -23,15 +22,31 @@ public class ChatJoinRequest implements BotApiObject {
private static final String BIO_FIELD = "bio";
private static final String INVITELINK_FIELD = "invite_link";


/**
* Chat to which the request was sent
*/
@JsonProperty(CHAT_FIELD)
private Chat chat; ///< Chat to which the request was sent
private Chat chat;
/**
* User that sent the join request
*/
@JsonProperty(FROM_FIELD)
private User user; ///< User that sent the join request
private User user;
/**
* Date the request was sent in Unix time
*/
@JsonProperty(DATE_FIELD)
private Integer date; ///< Date the request was sent in Unix time
private Integer date;
/**
* Optional.
* Bio of the user.
*/
@JsonProperty(BIO_FIELD)
private String bio; ///< Optional. Bio of the user.
private String bio;
/**
* Optional.
* Chat invite link that was used by the user to send the join request
*/
@JsonProperty(INVITELINK_FIELD)
private ChatInviteLink inviteLink; ///< Optional. Chat invite link that was used by the user to send the join request
private ChatInviteLink inviteLink;
}
Loading

0 comments on commit 4db7532

Please sign in to comment.