Skip to content

Commit a45087a

Browse files
committed
Api Version 8.1
1 parent fd91bf8 commit a45087a

File tree

17 files changed

+158
-21
lines changed

17 files changed

+158
-21
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
99
<packaging>pom</packaging>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111

1212
<modules>
1313
<module>telegrambots-meta</module>

telegrambots-abilities/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-abilities</artifactId>
@@ -104,12 +104,12 @@
104104
<dependency>
105105
<groupId>org.telegram</groupId>
106106
<artifactId>telegrambots-webhook</artifactId>
107-
<version>8.0.0</version>
107+
<version>8.1.0</version>
108108
</dependency>
109109
<dependency>
110110
<groupId>org.telegram</groupId>
111111
<artifactId>telegrambots-longpolling</artifactId>
112-
<version>8.0.0</version>
112+
<version>8.1.0</version>
113113
</dependency>
114114

115115
<dependency>

telegrambots-client-jetty-adapter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111
</parent>
1212

1313
<name>Telegram Bots Client Jetty HttpClient adapter</name>

telegrambots-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111
</parent>
1212

1313
<name>Telegram Bots Client</name>

telegrambots-extensions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
1616
<dependency>
1717
<groupId>org.telegram</groupId>
1818
<artifactId>telegrambots-extensions</artifactId>
19-
<version>8.0.0</version>
19+
<version>8.1.0</version>
2020
</dependency>
2121
```
2222

2323
2. Using Gradle:
2424

2525
```gradle
26-
implementation 'org.telegram:telegrambots-extensions:8.0.0'
26+
implementation 'org.telegram:telegrambots-extensions:8.1.0'
2727
```

telegrambots-extensions/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-extensions</artifactId>
@@ -89,12 +89,12 @@
8989
<dependency>
9090
<groupId>org.telegram</groupId>
9191
<artifactId>telegrambots-webhook</artifactId>
92-
<version>8.0.0</version>
92+
<version>8.1.0</version>
9393
</dependency>
9494
<dependency>
9595
<groupId>org.telegram</groupId>
9696
<artifactId>telegrambots-longpolling</artifactId>
97-
<version>8.0.0</version>
97+
<version>8.1.0</version>
9898
</dependency>
9999

100100
<dependency>

telegrambots-longpolling/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
9-
<version>8.0.0</version>
9+
<version>8.1.0</version>
1010
</parent>
1111

1212
<artifactId>telegrambots-longpolling</artifactId>

telegrambots-meta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-meta</artifactId>

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransaction.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
public class StarTransaction implements BotApiObject {
3333
private static final String ID_FIELD = "id";
3434
private static final String AMOUNT_FIELD = "amount";
35+
private static final String NANO_STAR_AMOUNT_FIELD = "nanostar_amount";
3536
private static final String DATE_FIELD = "date";
3637
private static final String SOURCE_FIELD = "source";
3738
private static final String RECEIVER_FIELD = "receiver";
@@ -45,7 +46,7 @@ public class StarTransaction implements BotApiObject {
4546
@NonNull
4647
private String id;
4748
/**
48-
* Number of Telegram Stars transferred by the transaction
49+
* Integer amount of Telegram Stars transferred by the transaction
4950
*/
5051
@JsonProperty(AMOUNT_FIELD)
5152
@NonNull
@@ -70,4 +71,10 @@ public class StarTransaction implements BotApiObject {
7071
*/
7172
@JsonProperty(RECEIVER_FIELD)
7273
private TransactionPartner receiver;
74+
/**
75+
* Optional.
76+
* The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999
77+
*/
78+
@JsonProperty(NANO_STAR_AMOUNT_FIELD)
79+
private Integer nanoStarAmount;
7380
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
import lombok.EqualsAndHashCode;
7+
import lombok.Getter;
8+
import lombok.NonNull;
9+
import lombok.RequiredArgsConstructor;
10+
import lombok.Setter;
11+
import lombok.ToString;
12+
import lombok.experimental.SuperBuilder;
13+
import lombok.extern.jackson.Jacksonized;
14+
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
15+
import org.telegram.telegrambots.meta.api.objects.User;
16+
import org.telegram.telegrambots.meta.api.objects.chat.Chat;
17+
18+
/**
19+
* @author Ruben Bermudez
20+
* @version 8.1
21+
* Contains information about the affiliate that received a commission via this transaction.
22+
*/
23+
@EqualsAndHashCode(callSuper = false)
24+
@Getter
25+
@Setter
26+
@ToString
27+
@RequiredArgsConstructor
28+
@SuperBuilder
29+
@Jacksonized
30+
@JsonIgnoreProperties(ignoreUnknown = true)
31+
@JsonInclude(JsonInclude.Include.NON_NULL)
32+
public class AffiliateInfo implements BotApiObject {
33+
private static final String AFFILIATE_USER_FIELD = "affiliate_user";
34+
private static final String AFFILIATE_CHAT_FIELD = "affiliate_chat";
35+
private static final String COMMISSION_PER_MILLE_FIELD = "commission_per_mille";
36+
private static final String AMOUNT_FIELD = "amount";
37+
private static final String NANO_STAR_AMOUNT_FIELD = "nanostar_amount";
38+
39+
/**
40+
* Optional.
41+
* The bot or the user that received an affiliate commission if it was received by a bot or a user
42+
*/
43+
@JsonProperty(AFFILIATE_USER_FIELD)
44+
private User affiliateUser;
45+
/**
46+
* Optional.
47+
* The chat that received an affiliate commission if it was received by a chat
48+
*/
49+
@JsonProperty(AFFILIATE_CHAT_FIELD)
50+
private Chat affiliateChat;
51+
/**
52+
* The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users
53+
*/
54+
@JsonProperty(COMMISSION_PER_MILLE_FIELD)
55+
@NonNull
56+
private Integer commissionPerMille;
57+
/**
58+
* Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds
59+
*/
60+
@JsonProperty(AMOUNT_FIELD)
61+
@NonNull
62+
private Integer amount;
63+
/**
64+
* Optional.
65+
* The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds
66+
*/
67+
@JsonProperty(NANO_STAR_AMOUNT_FIELD)
68+
private Integer nanoStarAmount;
69+
}

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartner.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* TransactionPartnerFragment
1515
* TransactionPartnerUser
1616
* TransactionPartnerOther
17+
* TransactionPartnerTelegramAds
18+
* TransactionPartnerTelegramApi
19+
* TransactionPartnerAffiliateProgram
1720
*/
1821
@JsonTypeInfo(
1922
use = JsonTypeInfo.Id.NAME,
@@ -26,7 +29,8 @@
2629
@JsonSubTypes.Type(value = TransactionPartnerUser.class, name = "user"),
2730
@JsonSubTypes.Type(value = TransactionPartnerOther.class, name = "other"),
2831
@JsonSubTypes.Type(value = TransactionPartnerTelegramAds.class, name = "telegram_ads"),
29-
@JsonSubTypes.Type(value = TransactionPartnerTelegramApi.class, name = "telegram_api")
32+
@JsonSubTypes.Type(value = TransactionPartnerTelegramApi.class, name = "telegram_api"),
33+
@JsonSubTypes.Type(value = TransactionPartnerAffiliateProgram.class, name = "affiliate_program")
3034
})
3135
public interface TransactionPartner extends Validable, BotApiObject {
3236
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import lombok.EqualsAndHashCode;
6+
import lombok.Getter;
7+
import lombok.RequiredArgsConstructor;
8+
import lombok.Setter;
9+
import lombok.ToString;
10+
import lombok.experimental.SuperBuilder;
11+
import lombok.extern.jackson.Jacksonized;
12+
import org.telegram.telegrambots.meta.api.objects.User;
13+
14+
/**
15+
* @author Ruben Bermudez
16+
* @version 8.1
17+
*
18+
* Describes the affiliate program that issued the affiliate commission received via this transaction.
19+
*/
20+
21+
@EqualsAndHashCode(callSuper = false)
22+
@Getter
23+
@Setter
24+
@ToString
25+
@RequiredArgsConstructor
26+
@Jacksonized
27+
@JsonIgnoreProperties(ignoreUnknown = true)
28+
@SuperBuilder
29+
public class TransactionPartnerAffiliateProgram implements TransactionPartner {
30+
private static final String TYPE_FIELD = "type";
31+
private static final String SPONSOR_USER_FIELD = "sponsor_user";
32+
private static final String COMMISSION_PER_MILLE_FIELD = "commission_per_mille";
33+
34+
/**
35+
* Type of the transaction partner, always “affiliate_program”
36+
*/
37+
@JsonProperty(TYPE_FIELD)
38+
private final String type = "affiliate_program";
39+
/**
40+
* Optional.
41+
* Information about the bot that sponsored the affiliate program
42+
*/
43+
@JsonProperty(SPONSOR_USER_FIELD)
44+
private User sponsorUser;
45+
/**
46+
* The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users
47+
*/
48+
@JsonProperty(COMMISSION_PER_MILLE_FIELD)
49+
private Integer commissionPerMille;
50+
}

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerUser.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class TransactionPartnerUser implements TransactionPartner {
4040
private static final String PAID_MEDIA_PAYLOAD_FIELD = "paid_media_payload";
4141
private static final String GIFT_FIELD = "gift";
4242
private static final String SUBSCRIPTION_PERIOD_FIELD = "subscription_period";
43+
private static final String AFFILIATE_FIELD = "affiliate";
4344

4445
/**
4546
* Type of the transaction partner, always “user”
@@ -85,4 +86,10 @@ public class TransactionPartnerUser implements TransactionPartner {
8586
*/
8687
@JsonProperty(SUBSCRIPTION_PERIOD_FIELD)
8788
private Integer subscriptionPeriod;
89+
/**
90+
* Optional.
91+
* Information about the affiliate that received a commission via this transaction
92+
*/
93+
@JsonProperty(AFFILIATE_FIELD)
94+
private AffiliateInfo affiliate;
8895
}

telegrambots-springboot-longpolling-starter/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.0.0</version>
10+
<version>8.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-springboot-longpolling-starter</artifactId>
@@ -71,7 +71,7 @@
7171
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
7272
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
7373

74-
<telegrambots.version>8.0.0</telegrambots.version>
74+
<telegrambots.version>8.1.0</telegrambots.version>
7575
<spring.version>3.2.3</spring.version>
7676
</properties>
7777

telegrambots-springboot-webhook-starter/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
9-
<version>8.0.0</version>
9+
<version>8.1.0</version>
1010
</parent>
1111

1212
<artifactId>telegrambots-springboot-webhook-starter</artifactId>
@@ -71,7 +71,7 @@
7171
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
7272
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
7373

74-
<telegrambots.version>8.0.0</telegrambots.version>
74+
<telegrambots.version>8.1.0</telegrambots.version>
7575
<spring.version>3.2.3</spring.version>
7676
<jackson.version>2.17.2</jackson.version>
7777
</properties>

telegrambots-test-reports/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
9-
<version>8.0.0</version>
9+
<version>8.1.0</version>
1010
</parent>
1111

1212
<artifactId>telegrambots-test-reports</artifactId>

telegrambots-webhook/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
9-
<version>8.0.0</version>
9+
<version>8.1.0</version>
1010
</parent>
1111

1212
<artifactId>telegrambots-webhook</artifactId>

0 commit comments

Comments
 (0)