Skip to content

Commit

Permalink
Api version 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenlagus committed Feb 5, 2023
1 parent 402a4c4 commit 61eb857
Show file tree
Hide file tree
Showing 28 changed files with 540 additions and 70 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambots:6.4.0'
implementation 'org.telegram:telegrambots:6.5.0'
```

3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/6.4.0)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/6.4.0)
3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/6.5.0)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/6.5.0)

In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`.

Expand Down
3 changes: 3 additions & 0 deletions TelegramBots.wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### <a id="6.4.0"></a>6.4.0 ###
1. Update Api version [6.5](https://core.telegram.org/bots/api-changelog#february-3-2023)

### <a id="6.4.0"></a>6.4.0 ###
1. Update Api version [6.4](https://core.telegram.org/bots/api-changelog#december-30-2022)
2. Bug fixing: #1159
Expand Down
4 changes: 2 additions & 2 deletions TelegramBots.wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ First you need to acquire the library and add it to your project. There are seve
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
```
* With **Gradle**:

```gradle
implementation 'org.telegram:telegrambots:6.4.0'
implementation 'org.telegram:telegrambots:6.5.0'
```

2. Don't like the **Maven Central Repository**? It can also be grabbed from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots).
Expand Down
4 changes: 2 additions & 2 deletions TelegramBots.wiki/abilities/Simple-Example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ As with any Java project, you will need to set your dependencies.
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
```
* **Gradle**
```gradle
implementation 'org.telegram:telegrambots-abilities:6.4.0'
implementation 'org.telegram:telegrambots-abilities:6.5.0'
```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)

Expand Down
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>6.4.0</version>
<version>6.5.0</version>

<modules>
<module>telegrambots</module>
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-abilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'org.telegram:telegrambots-abilities:6.4.0'
implementation 'org.telegram:telegrambots-abilities:6.5.0'
```

**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1)
Expand Down
4 changes: 2 additions & 2 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>6.4.0</version>
<version>6.5.0</version>
</parent>

<artifactId>telegrambots-abilities</artifactId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-chat-session-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-chat-session-bot</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'org.telegram:telegrambots-chat-session-bot:6.4.0'
implementation 'org.telegram:telegrambots-chat-session-bot:6.5.0'
```

Motivation
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-chat-session-bot/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>6.4.0</version>
<version>6.5.0</version>
</parent>

<artifactId>telegrambots-chat-session-bot</artifactId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->
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>telegrambotsextensions</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambotsextensions:6.4.0'
implementation 'org.telegram:telegrambotsextensions:6.5.0'
```
4 changes: 2 additions & 2 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>6.4.0</version>
<version>6.5.0</version>
</parent>

<artifactId>telegrambotsextensions</artifactId>
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.4.0</version>
<version>6.5.0</version>
</dependency>
</dependencies>

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>6.4.0</version>
<version>6.5.0</version>
</parent>

<artifactId>telegrambots-meta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,20 @@ public class RestrictChatMember extends BotApiMethodBoolean {
private static final String CANSENDOTHERMESSAGES_FIELD = "can_send_other_messages";
private static final String CANADDWEBPAGEPREVIEWS_FIELD = "can_add_web_page_previews";
private static final String PERMISSIONS_FIELD = "permissions";
private static final String USEINDEPENDENTCHATPERMISSIONS_FIELD = "use_independent_chat_permissions";

/**
* Required. Unique identifier for the chat to send the message to (Or username for channels)
*/
@JsonProperty(CHATID_FIELD)
@NonNull
private String chatId; ///< Required. Unique identifier for the chat to send the message to (Or username for channels)
private String chatId;
/**
* Required. Unique identifier of the target user
*/
@JsonProperty(USER_ID_FIELD)
@NonNull
private Long userId; ///< Required. Unique identifier of the target user
private Long userId;
/**
* Optional
* Date when restrictions will be lifted for the user, unix time.
Expand All @@ -64,8 +71,22 @@ public class RestrictChatMember extends BotApiMethodBoolean {
@JsonProperty(PERMISSIONS_FIELD)
@NonNull
private ChatPermissions permissions;
/**
* Optional.
* Date when restrictions will be lifted for the user, unix time.
* If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be banned forever
*/
@JsonProperty(UNTILDATE_FIELD)
private Integer untilDate; ///< Optional. Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be banned forever
private Integer untilDate;
/**
* Optional.
* Pass True if chat permissions are set independently.
* Otherwise, the can_send_other_messages and can_add_web_page_previews permissions
* will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes,
* and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
*/
@JsonProperty(USEINDEPENDENTCHATPERMISSIONS_FIELD)
private Boolean useIndependentChatPermissions;

@Tolerate
public void setChatId(@NonNull Long chatId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,29 @@ public class SetChatPermissions extends BotApiMethodBoolean {

private static final String CHAT_ID_FIELD = "chat_id";
private static final String PERMISSIONS_FIELD = "permissions";
private static final String USEINDEPENDENTCHATPERMISSIONS_FIELD = "use_independent_chat_permissions";

/**
* Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
*/
@JsonProperty(CHAT_ID_FIELD)
@NonNull
private String chatId; ///< Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
private String chatId;
/**
* New default chat permissions
*/
@JsonProperty(PERMISSIONS_FIELD)
@NonNull
private ChatPermissions permissions; ///< New default chat permissions
private ChatPermissions permissions;
/**
* Optional.
* Pass True if chat permissions are set independently.
* Otherwise, the can_send_other_messages and can_add_web_page_previews permissions
* will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes,
* and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
*/
@JsonProperty(USEINDEPENDENTCHATPERMISSIONS_FIELD)
private Boolean useIndependentChatPermissions;

@Tolerate
public void setChatId(@NonNull Long chatId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ChatJoinRequest implements BotApiObject {
private static final String DATE_FIELD = "date";
private static final String BIO_FIELD = "bio";
private static final String INVITELINK_FIELD = "invite_link";
private static final String USERCHATID_FIELD = "user_chat_id";

/**
* Chat to which the request was sent
Expand Down Expand Up @@ -49,4 +50,12 @@ public class ChatJoinRequest implements BotApiObject {
*/
@JsonProperty(INVITELINK_FIELD)
private ChatInviteLink inviteLink;
/**
* Identifier of a private chat with the user who sent the join request.
* This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
* But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
* @apiNote The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.
*/
@JsonProperty(USERCHATID_FIELD)
private Long userChatId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@
@Builder
public class ChatPermissions implements BotApiObject {
private static final String CAN_SEND_MESSAGES_FIELD = "can_send_messages";
private static final String CAN_SEND_MEDIA_MESSAGES_FIELD = "can_send_media_messages";
private static final String CANSENDAUDIOS_FIELD = "can_send_audios";
private static final String CANSENDDOCUMENTS_FIELD = "can_send_documents";
private static final String CANSENDPHOTOS_FIELD = "can_send_photos";
private static final String CANSENDVIDEOS_FIELD = "can_send_videos";
private static final String CANSENDVIDEONOTES_FIELD = "can_send_video_notes";
private static final String CANSENDVOICENOTES_FIELD = "can_send_voice_notes";
private static final String CAN_SEND_POLLS_FIELD = "can_send_polls";
private static final String CAN_SEND_OTHER_MESSAGES_FIELD = "can_send_other_messages";
private static final String CAN_ADD_WEB_PAGE_PREVIEWS_FIELD = "can_add_web_page_previews";
private static final String CAN_CHANGE_INFO_FIELD = "can_change_info";
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 CAN_SEND_MEDIA_MESSAGES_FIELD = "can_send_media_messages";

/**
* Optional.
Expand All @@ -41,11 +49,35 @@ public class ChatPermissions implements BotApiObject {
@JsonProperty(CAN_SEND_MESSAGES_FIELD)
private Boolean canSendMessages;
/**
* Optional.
* True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
* True, if the user is allowed to send audios
*/
@JsonProperty(CAN_SEND_MEDIA_MESSAGES_FIELD)
private Boolean canSendMediaMessages;
@JsonProperty(CANSENDAUDIOS_FIELD)
private Boolean canSendAudios;
/**
* True, if the user is allowed to send documents
*/
@JsonProperty(CANSENDDOCUMENTS_FIELD)
private Boolean canSendDocuments;
/**
* True, if the user is allowed to send photos
*/
@JsonProperty(CANSENDPHOTOS_FIELD)
private Boolean canSendPhotos;
/**
* True, if the user is allowed to send videos
*/
@JsonProperty(CANSENDVIDEOS_FIELD)
private Boolean canSendVideos;
/**
* True, if the user is allowed to send video notes
*/
@JsonProperty(CANSENDVIDEONOTES_FIELD)
private Boolean canSendVideoNotes;
/**
* Optional. True, if the user is allowed to send voice notes
*/
@JsonProperty(CANSENDVOICENOTES_FIELD)
private Boolean canSendVoiceNotes;
/**
* Optional.
* True, if the user is allowed to send polls, implies can_send_messages
Expand Down Expand Up @@ -82,4 +114,19 @@ public class ChatPermissions implements BotApiObject {
*/
@JsonProperty(CAN_PIN_MESSAGES_FIELD)
private Boolean canPinMessages;
/**
* Optional. True, if the user is allowed to create forum topics.
* If omitted defaults to the value of can_pin_messages
*/
@JsonProperty(CANMANAGETOPICS_FIELD)
private Boolean canManageTopics;

/**
* Optional.
* True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
* @deprecated Use individual permissions
*/
@JsonProperty(CAN_SEND_MEDIA_MESSAGES_FIELD)
@Deprecated
private Boolean canSendMediaMessages;
}
Loading

0 comments on commit 61eb857

Please sign in to comment.