File tree Expand file tree Collapse file tree 9 files changed +76
-6
lines changed Expand file tree Collapse file tree 9 files changed +76
-6
lines changed Original file line number Diff line number Diff line change 5
5
[ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=alert_status )] ( https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot )
6
6
[ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=coverage )] ( https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot )
7
7
8
- RxTelegram.Bot supports Telegram Bot API 8.0 (as at November 17 , 2024).
8
+ RxTelegram.Bot supports Telegram Bot API 8.1 (as at December 4 , 2024).
9
9
10
10
This is a reactive designed .NET Library for the Telegram Bot API. It works with the official [ Reactive Extentions] ( https://github.com/dotnet/reactive ) .
11
11
Original file line number Diff line number Diff line change @@ -15,10 +15,12 @@ public enum TransactionPartnerType
15
15
[ ImplementationType ( typeof ( TransactionPartnerTelegramAds ) ) ]
16
16
TelegramAds ,
17
17
18
-
19
18
[ ImplementationType ( typeof ( TransactionPartnerOther ) ) ]
20
19
Other ,
21
20
22
21
[ ImplementationType ( typeof ( TransactionPartnerTelegramApi ) ) ]
23
- TelegramApi
22
+ TelegramApi ,
23
+
24
+ [ ImplementationType ( typeof ( TransactionPartnerAffiliateProgram ) ) ]
25
+ AffiliateProgram
24
26
}
Original file line number Diff line number Diff line change
1
+ using RxTelegram . Bot . Interface . BaseTypes ;
2
+
3
+ namespace RxTelegram . Bot . Interface . Payments ;
4
+
5
+ /// <summary>
6
+ /// Contains information about the affiliate that received a commission via this transaction.
7
+ /// </summary>
8
+ public class AffiliateInfo
9
+ {
10
+ /// <summary>
11
+ /// Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user
12
+ /// </summary>
13
+ public User AffiliateUser { get ; set ; }
14
+
15
+ /// <summary>
16
+ /// Optional. The chat that received an affiliate commission if it was received by a chat
17
+ /// </summary>
18
+ public Chat AffiliateChat { get ; set ; }
19
+
20
+ /// <summary>
21
+ /// The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users
22
+ /// </summary>
23
+ public int CommissionPerMille { get ; set ; }
24
+
25
+ /// <summary>
26
+ /// Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0;
27
+ /// can be negative for refunds
28
+ /// </summary>
29
+ public int Amount { get ; set ; }
30
+
31
+ /// <summary>
32
+ /// Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999;
33
+ /// can be negative for refunds
34
+ /// </summary>
35
+ public int ? NanostarAmount { get ; set ; }
36
+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ public class StarTransaction
16
16
/// </summary>
17
17
public int Amount { get ; set ; }
18
18
19
+ /// <summary>
20
+ /// Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999
21
+ /// </summary>
22
+ public int ? NanostarAmount { get ; set ; }
23
+
19
24
/// <summary>
20
25
/// Date the transaction was created in Unix time
21
26
/// </summary>
Original file line number Diff line number Diff line change
1
+ using RxTelegram . Bot . Interface . BaseTypes ;
2
+ using RxTelegram . Bot . Interface . BaseTypes . Enums ;
3
+
4
+ namespace RxTelegram . Bot . Interface . Payments ;
5
+
6
+ /// <summary>
7
+ /// Describes the affiliate program that issued the affiliate commission received via this transaction.
8
+ /// </summary>
9
+ public class TransactionPartnerAffiliateProgram : TransactionPartner
10
+ {
11
+ /// <summary>
12
+ /// Type of the transaction partner, always “affiliate_program”
13
+ /// </summary>
14
+ public override TransactionPartnerType Type { get ; set ; } = TransactionPartnerType . AffiliateProgram ;
15
+
16
+ /// <summary>
17
+ /// Optional. Information about the bot that sponsored the affiliate program
18
+ /// </summary>
19
+ public User SponsorUser { get ; set ; }
20
+
21
+ /// <summary>
22
+ /// The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users
23
+ /// </summary>
24
+ public int CommissionPerMille { get ; set ; }
25
+ }
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ public class TransactionPartnerOther : TransactionPartner
10
10
/// <summary>
11
11
/// Type of the transaction partner, always “other”
12
12
/// </summary>
13
- public override TransactionPartnerType Type { get ; set ; }
13
+ public override TransactionPartnerType Type { get ; set ; } = TransactionPartnerType . Other ;
14
14
}
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ public class TransactionPartnerTelegramAds : TransactionPartner
10
10
/// <summary>
11
11
/// Type of the transaction partner, always “telegram_ads”
12
12
/// </summary>
13
- public override TransactionPartnerType Type { get ; set ; }
13
+ public override TransactionPartnerType Type { get ; set ; } = TransactionPartnerType . TelegramAds ;
14
14
}
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ public class TransactionPartnerUser : TransactionPartner
20
20
/// </summary>
21
21
public User User { get ; set ; }
22
22
23
+ public AffiliateInfo Affiliate { get ; set ; }
24
+
23
25
/// <summary>
24
26
/// Optional. Bot-specified invoice payload
25
27
/// </summary>
Original file line number Diff line number Diff line change 10
10
<RepositoryUrl >https://github.com/RxTelegram/RxTelegram.Bot</RepositoryUrl >
11
11
<RepositoryType >git</RepositoryType >
12
12
<PackageTags >Telegram;Bot;Api;Rx;Reactive;Observable;RxTelegram;RxTelegram.Bot</PackageTags >
13
- <PackageVersion >8.0 .0</PackageVersion >
13
+ <PackageVersion >8.1 .0</PackageVersion >
14
14
<PackageIcon >icon.png</PackageIcon >
15
15
<GenerateDocumentationFile >true</GenerateDocumentationFile >
16
16
<DocumentationFile >bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile >
You can’t perform that action at this time.
0 commit comments