Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c27ce3a
Api Version 9.0
rubenlagus Jun 10, 2025
bdf6955
Merge branch 'master' into dev
rubenlagus Jun 12, 2025
ca6bd64
Merge branch 'master' into dev
rubenlagus Jun 15, 2025
d924e4b
feat(Message): create `Message#getCommand` method
yvasyliev Jun 20, 2025
1dba159
feat(Message): add `Message#entities` null check to the `Message#getC…
yvasyliev Jun 20, 2025
f3e469b
Merge branch 'dev' into feature/get-command
yvasyliev Jun 21, 2025
921fce1
doc(Message): return back @apiNote
yvasyliev Jun 27, 2025
51af81f
feat(Message): early return `null` command if no command found
yvasyliev Jul 14, 2025
9203912
Api Version 9.2
rubenlagus Sep 7, 2025
ce62f0e
Fix UniqueGiftBackdrop json fields (#1541)
denisklebanovich Oct 12, 2025
22efa2f
feat(Message): replace Java Stream block with plain `for` loop for be…
yvasyliev Dec 27, 2025
84d0f06
Fix videoStartTimestamp type from Boolean to Integer
aNNiMON Jan 2, 2026
afca84b
Add missing fields from API 9.2 to SendInvoice
aNNiMON Jan 3, 2026
be56d12
Merge branch 'fix-api-types' of https://github.com/aNNiMON/TelegramBo…
rubenlagus Jan 3, 2026
3a81d62
Merge branch 'aNNiMON-fix-api-types' into dev
rubenlagus Jan 3, 2026
db1b135
Fix merge conflict
rubenlagus Jan 3, 2026
464ecfd
Fix topicId type
prokop7 Nov 5, 2025
1bc4481
change TestDeleteStory to deterministic implementation
anthonyx24 Nov 13, 2025
cec7ca2
change json serialization unit tests to deterministic impl
anthonyx24 Dec 3, 2025
cada499
Fix AbilityBot channel updates: logic moved to AbilityUtils, added pr…
kotopyos Dec 22, 2025
efeeca5
Added: validate method to ReplyFlowBuilder
kotopyos Dec 25, 2025
b60cb94
Feature: added protected hooks for handling Input, Locality and Priva…
kotopyos Dec 31, 2025
9c0de05
Merge branch 'dev' into feature/get-command
rubenlagus Jan 3, 2026
5dff709
Merge branch 'master' into feature/get-command
yvasyliev Jan 4, 2026
f8592d7
Merge remote-tracking branch 'origin/feature/get-command' into featur…
yvasyliev Jan 4, 2026
a33da45
feat(Message): check entities & text existence in `Message#getCommand…
yvasyliev Jan 4, 2026
e4d3c85
Api Version 9.5
rubenlagus Mar 1, 2026
ba30621
Merge branch 'dev' into feature/get-command
yvasyliev Mar 2, 2026
c3fa48f
feat: simplify `Message#getCommand` body
yvasyliev Mar 2, 2026
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<packaging>pom</packaging>
<version>9.4.0</version>
<version>9.5.0</version>

<modules>
<module>telegrambots-meta</module>
Expand Down
6 changes: 3 additions & 3 deletions telegrambots-abilities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</parent>

<artifactId>telegrambots-abilities</artifactId>
Expand Down Expand Up @@ -93,12 +93,12 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-webhook</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-longpolling</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-client-jetty-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</parent>

<name>Telegram Bots Client Jetty HttpClient adapter</name>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</parent>

<name>Telegram Bots Client</name>
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-extensions</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambots-extensions:9.4.0'
implementation 'org.telegram:telegrambots-extensions:9.5.0'
```
6 changes: 3 additions & 3 deletions telegrambots-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</parent>

<artifactId>telegrambots-extensions</artifactId>
Expand Down Expand Up @@ -78,12 +78,12 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-webhook</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-longpolling</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-longpolling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</parent>

<artifactId>telegrambots-longpolling</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-meta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>9.4.0</version>
<version>9.5.0</version>
</parent>

<artifactId>telegrambots-meta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class PromoteChatMember extends BotApiMethodBoolean {
private static final String CAN_EDIT_STORIES_FIELD = "can_edit_stories";
private static final String CAN_DELETE_STORIES_FIELD = "can_delete_stories";
private static final String CAN_MANAGE_DIRECT_MESSAGES_FIELD = "can_manage_direct_messages";
private static final String CAN_MANAGE_TAGS_FIELD = "can_manage_tags";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand Down Expand Up @@ -138,6 +139,12 @@ public class PromoteChatMember extends BotApiMethodBoolean {
*/
@JsonProperty(CAN_MANAGE_DIRECT_MESSAGES_FIELD)
private Boolean canManageDirectMessages;
/**
* Optional
* Pass True if the administrator can edit the tags of regular members; for groups and supergroups only
*/
@JsonProperty(CAN_MANAGE_TAGS_FIELD)
private Boolean canManageTags;

@Tolerate
public void setChatId(@NonNull Long chatId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package org.telegram.telegrambots.meta.api.methods.groupadministration;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import lombok.experimental.Tolerate;
import lombok.extern.jackson.Jacksonized;
import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
import org.telegram.telegrambots.meta.util.Validations;

/**
* @author Ruben Bermudez
* @version 9.5
* Use this method to set a tag for a regular member in a group or a supergroup.
* The bot must be an administrator in the chat for this to work and must have the "can_manage_tags" administrator right.
* Returns True on success.
*/
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SetChatMemberTag extends BotApiMethodBoolean {
public static final String PATH = "setChatMemberTag";

private static final String CHATID_FIELD = "chat_id";
private static final String USERID_FIELD = "user_id";
private static final String TAG_FIELD = "tag";

@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
@JsonProperty(USERID_FIELD)
@NonNull
private Long userId; ///< Unique identifier of the target user
@JsonProperty(TAG_FIELD)
private String tag; ///< Optional. New tag for the member; 0-16 characters, emoji are not allowed

@Tolerate
public void setChatId(@NonNull Long chatId) {
this.chatId = chatId.toString();
}

@Override
public String getMethod() {
return PATH;
}

@Override
public void validate() throws TelegramApiValidationException {
Validations.requiredChatId(chatId, this);
Validations.requiredUserId(userId, this);
}

public static abstract class SetChatMemberTagBuilder<C extends SetChatMemberTag, B extends SetChatMemberTagBuilder<C, B>> extends BotApiMethodBooleanBuilder<C, B> {
@Tolerate
public SetChatMemberTagBuilder<C, B> chatId(@NonNull Long chatId) {
this.chatId = chatId.toString();
return this;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

/**
* @author Ruben Bermudez
* @version 9.3
* Use this method to stream a partial message to a user while the message is being generated;
* supported only for bots with forum topic mode enabled. Returns True on success.
* @version 9.5
* Use this method to stream a partial message to a user while the message is being generated.
* Returns True on success.
*/
@SuppressWarnings("unused")
@EqualsAndHashCode(callSuper = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class ChatPermissions implements BotApiObject {
private static final String CAN_INVITE_USERS_FIELD = "can_invite_users";
private static final String CAN_PIN_MESSAGES_FIELD = "can_pin_messages";
private static final String CANMANAGETOPICS_FIELD = "can_manage_topics";
private static final String CANEDITTAG_FIELD = "can_edit_tag";

private static final String CAN_SEND_MEDIA_MESSAGES_FIELD = "can_send_media_messages";

Expand Down Expand Up @@ -126,4 +127,10 @@ public class ChatPermissions implements BotApiObject {
*/
@JsonProperty(CANMANAGETOPICS_FIELD)
private Boolean canManageTopics;
/**
* Optional.
* True, if the user is allowed to edit their own tag
*/
@JsonProperty(CANEDITTAG_FIELD)
private Boolean canEditTag;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class MessageEntity implements BotApiObject {
private static final String USER_FIELD = "user";
private static final String LANGUAGE_FIELD = "language";
private static final String CUSTOMEMOJI_FIELD = "custom_emoji_id";
private static final String UNIX_TIME_FIELD = "unix_time";
private static final String DATE_TIME_FORMAT_FIELD = "date_time_format";
/**
* Type of the entity.
* Currently, can be
Expand All @@ -58,10 +60,11 @@ public class MessageEntity implements BotApiObject {
* - “blockquote” (block quotation),
* - “expandable_blockquote” (collapsed-by-default block quotation),
* - “code” (monowidth string),
* - “pre” (monowidth block),
* - “text_link” (for clickable text URLs),
* - “text_mention” (for users without usernames),
* - “custom_emoji” (for inline custom emoji stickers)
* - "pre" (monowidth block),
* - "text_link" (for clickable text URLs),
* - "text_mention" (for users without usernames),
* - "custom_emoji" (for inline custom emoji stickers),
* - "date_time" (for formatted date and time)
*/
@JsonProperty(TYPE_FIELD)
@NonNull
Expand Down Expand Up @@ -98,11 +101,24 @@ public class MessageEntity implements BotApiObject {
private String language;
/**
* Optional.
* For custom_emoji only, unique identifier of the custom emoji.
* For "custom_emoji" only, unique identifier of the custom emoji.
* Use getCustomEmojiStickers to get full information about the sticker
*/
@JsonProperty(CUSTOMEMOJI_FIELD)
private String customEmojiId;
/**
* Optional.
* For "date_time" only, the Unix time associated with the entity
*/
@JsonProperty(UNIX_TIME_FIELD)
private Integer unixTime;
/**
* Optional.
* For "date_time" only, the string that defines the formatting of the date and time.
* See date-time entity formatting for more details.
*/
@JsonProperty(DATE_TIME_FORMAT_FIELD)
private String dateTimeFormat;
/**
* Text present in the entity. Computed from offset and length
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class ChatAdministratorRights implements BotApiObject, Validable {
private static final String CAN_EDIT_STORIES_FIELD = "can_edit_stories";
private static final String CAN_DELETE_STORIES_FIELD = "can_delete_stories";
private static final String CAN_MANAGE_DIRECT_MESSAGES_FIELD = "can_manage_direct_messages";
private static final String CAN_MANAGE_TAGS_FIELD = "can_manage_tags";

/**
* True, if the user's presence in the chat is hidden
Expand Down Expand Up @@ -150,4 +151,11 @@ public class ChatAdministratorRights implements BotApiObject, Validable {
*/
@JsonProperty(CAN_MANAGE_DIRECT_MESSAGES_FIELD)
private Boolean canManageDirectMessages;
/**
* Optional.
* True, if the administrator can edit the tags of regular members; for groups and supergroups only.
* If omitted defaults to the value of can_pin_messages.
*/
@JsonProperty(CAN_MANAGE_TAGS_FIELD)
private Boolean canManageTags;
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class ChatMemberAdministrator implements ChatMember {
private static final String CAN_EDIT_STORIES_FIELD = "can_edit_stories";
private static final String CAN_DELETE_STORIES_FIELD = "can_delete_stories";
private static final String CAN_MANAGE_DIRECT_MESSAGES_FIELD = "can_manage_direct_messages";
private static final String CAN_MANAGE_TAGS_FIELD = "can_manage_tags";

/**
* The member's status in the chat, always “administrator”
Expand Down Expand Up @@ -163,4 +164,11 @@ public class ChatMemberAdministrator implements ChatMember {
*/
@JsonProperty(CAN_MANAGE_DIRECT_MESSAGES_FIELD)
private Boolean canManageDirectMessages;
/**
* Optional.
* True, if the administrator can edit the tags of regular members; for groups and supergroups only.
* If omitted defaults to the value of can_pin_messages.
*/
@JsonProperty(CAN_MANAGE_TAGS_FIELD)
private Boolean canManageTags;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class ChatMemberMember implements ChatMember {
private static final String STATUS_FIELD = "status";
private static final String USER_FIELD = "user";
private static final String UNTIL_DATE_FIELD = "until_date";
private static final String TAG_FIELD = "tag";

/**
* The member's status in the chat, always “member”
Expand All @@ -56,4 +57,10 @@ public class ChatMemberMember implements ChatMember {
*/
@JsonProperty(UNTIL_DATE_FIELD)
private Integer untilDate;
/**
* Optional.
* Tag of the member
*/
@JsonProperty(TAG_FIELD)
private String tag;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class ChatMemberRestricted implements ChatMember {
private static final String CANPINMESSAGES_FIELD = "can_pin_messages";
private static final String CANMANAGETOPICS_FIELD = "can_manage_topics";
private static final String UNTILDATE_FIELD = "until_date";
private static final String TAG_FIELD = "tag";
private static final String CANEDITTAG_FIELD = "can_edit_tag";

private static final String CANSENDMEDIAMESSAGES_FIELD = "can_send_media_messages";

Expand Down Expand Up @@ -141,4 +143,15 @@ public class ChatMemberRestricted implements ChatMember {
*/
@JsonProperty(UNTILDATE_FIELD)
private Integer untilDate;
/**
* Optional.
* Tag of the member
*/
@JsonProperty(TAG_FIELD)
private String tag;
/**
* True, if the user is allowed to edit their own tag
*/
@JsonProperty(CANEDITTAG_FIELD)
private Boolean canEditTag;
}
Loading