@telegram.ts/types 1.18.1 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1718,7 +1718,7 @@ export type ApiMethods = {
1718
1718
  text_parse_mode?: ParseMode;
1719
1719
  /** A list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
1720
1720
  text_entities?: MessageEntity[];
1721
- }): Gifts;
1721
+ }): true;
1722
1722
 
1723
1723
  /** Use this method to send answers to an inline query. On success, True is returned.
1724
1724
  No more than 50 results per query are allowed.
@@ -1,4 +1,4 @@
1
- import type { User } from "./manageTypes";
1
+ import type { Chat, User } from "./manageTypes";
2
2
  import type { PaidMedia, Sticker } from "./messageTypes";
3
3
 
4
4
  /** This object represents a portion of the price for goods or services. */
@@ -161,10 +161,25 @@ export interface RevenueWithdrawalStateFailed {
161
161
  type: "failed";
162
162
  }
163
163
 
164
+ /** Contains information about the affiliate that received a commission via this transaction. */
165
+ export interface AffiliateInfo {
166
+ /** The bot or the user that received an affiliate commission if it was received by a bot or a user */
167
+ affiliate_user?: User;
168
+ /** The chat that received an affiliate commission if it was received by a chat */
169
+ affiliate_chat?: Chat;
170
+ /** The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */
171
+ commission_per_mille: number;
172
+ /** Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */
173
+ amount: number;
174
+ /** The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */
175
+ nanostar_amount?: number;
176
+ }
177
+
164
178
  /** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
165
179
 
166
180
  - TransactionPartnerUser
167
181
  - TransactionPartnerFragment
182
+ - TransactionPartnerAffiliateProgram
168
183
  - TransactionPartnerTelegramAds
169
184
  - TransactionPartnerTelegramApi
170
185
  - TransactionPartnerOther */
@@ -181,6 +196,8 @@ export interface TransactionPartnerUser {
181
196
  type: "user";
182
197
  /** Information about the user */
183
198
  user: User;
199
+ /** Information about the affiliate that received a commission via this transaction */
200
+ affiliate?: AffiliateInfo;
184
201
  /** The duration of the paid subscription */
185
202
  subscription_period?: number;
186
203
  /** Bot-specified invoice payload */
@@ -193,6 +210,16 @@ export interface TransactionPartnerUser {
193
210
  gift?: string;
194
211
  }
195
212
 
213
+ /** Describes the affiliate program that issued the affiliate commission received via this transaction. */
214
+ export interface TransactionPartnerAffiliateProgram {
215
+ /** Type of the transaction partner, always “affiliate_program” */
216
+ type: "affiliate_program";
217
+ /** Information about the bot that sponsored the affiliate program */
218
+ sponsor_user?: User;
219
+ /** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */
220
+ commission_per_mille: number;
221
+ }
222
+
196
223
  /** Describes a withdrawal transaction with Fragment. */
197
224
  export interface TransactionPartnerFragment {
198
225
  /** Type of the transaction partner, always “fragment” */
@@ -225,8 +252,10 @@ export interface TransactionPartnerOther {
225
252
  export interface StarTransaction {
226
253
  /** Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
227
254
  id: string;
228
- /** Number of Telegram Stars transferred by the transaction */
255
+ /** Integer amount of Telegram Stars transferred by the transaction */
229
256
  amount: number;
257
+ /** The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 */
258
+ nanostar_amount?: number;
230
259
  /** Date the transaction was created in Unix time */
231
260
  date: number;
232
261
  /** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */