@mtcute/core 0.27.2 → 0.27.4
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/client.cjs +80 -68
- package/client.js +80 -68
- package/highlevel/base.cjs +4 -0
- package/highlevel/base.d.cts +1 -0
- package/highlevel/base.d.ts +1 -0
- package/highlevel/base.js +4 -0
- package/highlevel/client.d.cts +484 -420
- package/highlevel/client.d.ts +484 -420
- package/highlevel/methods/files/download-iterable.cjs +4 -0
- package/highlevel/methods/files/download-iterable.d.cts +11 -1
- package/highlevel/methods/files/download-iterable.d.ts +11 -1
- package/highlevel/methods/files/download-iterable.js +4 -0
- package/highlevel/methods/files/download-stream.cjs +14 -0
- package/highlevel/methods/files/download-stream.d.cts +13 -2
- package/highlevel/methods/files/download-stream.d.ts +13 -2
- package/highlevel/methods/files/download-stream.js +14 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.cjs +30 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.cts +12 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.ts +12 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.js +25 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.cjs +17 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.d.cts +18 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.d.ts +18 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.js +12 -0
- package/highlevel/methods/gifts/send-star-gift-offer.cjs +26 -0
- package/highlevel/methods/gifts/send-star-gift-offer.d.cts +26 -0
- package/highlevel/methods/gifts/send-star-gift-offer.d.ts +26 -0
- package/highlevel/methods/gifts/send-star-gift-offer.js +21 -0
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.cjs +2 -5
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.cts +2 -2
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.ts +2 -2
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.js +2 -5
- package/highlevel/methods/premium/_normalize-stars-amount.cjs +18 -0
- package/highlevel/methods/premium/_normalize-stars-amount.d.cts +12 -0
- package/highlevel/methods/premium/_normalize-stars-amount.d.ts +12 -0
- package/highlevel/methods/premium/_normalize-stars-amount.js +13 -0
- package/highlevel/methods.d.cts +23 -18
- package/highlevel/methods.d.ts +23 -18
- package/highlevel/types/media/document-utils.cjs +1 -1
- package/highlevel/types/media/document-utils.js +1 -1
- package/highlevel/types/media/voice.cjs +6 -1
- package/highlevel/types/media/voice.d.cts +4 -1
- package/highlevel/types/media/voice.d.ts +4 -1
- package/highlevel/types/media/voice.js +6 -1
- package/highlevel/types/messages/message-action.cjs +27 -4
- package/highlevel/types/messages/message-action.d.cts +28 -1
- package/highlevel/types/messages/message-action.d.ts +28 -1
- package/highlevel/types/messages/message-action.js +27 -4
- package/highlevel/types/premium/saved-star-gift.cjs +4 -0
- package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
- package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
- package/highlevel/types/premium/saved-star-gift.js +4 -0
- package/highlevel/types/premium/star-gift-unique.cjs +8 -0
- package/highlevel/types/premium/star-gift-unique.d.cts +4 -0
- package/highlevel/types/premium/star-gift-unique.d.ts +4 -0
- package/highlevel/types/premium/star-gift-unique.js +8 -0
- package/highlevel/types/premium/star-gift.cjs +12 -3
- package/highlevel/types/premium/star-gift.d.cts +5 -0
- package/highlevel/types/premium/star-gift.d.ts +5 -0
- package/highlevel/types/premium/star-gift.js +12 -3
- package/highlevel/types/premium/stars-transaction.cjs +6 -0
- package/highlevel/types/premium/stars-transaction.d.cts +6 -0
- package/highlevel/types/premium/stars-transaction.d.ts +6 -0
- package/highlevel/types/premium/stars-transaction.js +6 -0
- package/highlevel/updates/manager.cjs +7 -0
- package/highlevel/updates/manager.js +7 -0
- package/methods.cjs +40 -34
- package/methods.js +23 -17
- package/network/middlewares/internal-errors.cjs +5 -0
- package/network/middlewares/internal-errors.js +5 -0
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/package.json +2 -2
- package/utils/binary/compat.cjs +12 -0
- package/utils/binary/compat.js +12 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.js +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.js +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.js +0 -0
package/highlevel/methods.d.cts
CHANGED
|
@@ -119,6 +119,28 @@ export { toggleForumTopicClosed } from './methods/forums/toggle-forum-topic-clos
|
|
|
119
119
|
export { toggleForumTopicPinned } from './methods/forums/toggle-forum-topic-pinned.js';
|
|
120
120
|
export { updateForumSettings } from './methods/forums/toggle-forum.js';
|
|
121
121
|
export { toggleGeneralTopicHidden } from './methods/forums/toggle-general-topic-hidden.js';
|
|
122
|
+
export { _normalizeInputStarGift } from './methods/gifts/_normalize-input-star-gift.js';
|
|
123
|
+
export { acceptStarGift } from './methods/gifts/accept-star-gift.js';
|
|
124
|
+
export { buyResaleGift } from './methods/gifts/buy-resale-gift.js';
|
|
125
|
+
export { getStarGiftResaleOptions } from './methods/gifts/get-resale-star-gifts.js';
|
|
126
|
+
export type { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/gifts/get-resale-star-gifts.js';
|
|
127
|
+
export { getSavedStarGiftsById } from './methods/gifts/get-saved-star-gifts-by-id.js';
|
|
128
|
+
export { getSavedStarGifts } from './methods/gifts/get-saved-star-gifts.js';
|
|
129
|
+
export { getStarGiftOptions } from './methods/gifts/get-star-gift-options.js';
|
|
130
|
+
export { getStarGiftUpgradeOptions } from './methods/gifts/get-star-gift-upgrade-options.js';
|
|
131
|
+
export type { StarGiftUpgradeOptions } from './methods/gifts/get-star-gift-upgrade-options.js';
|
|
132
|
+
export { getStarGiftValue } from './methods/gifts/get-star-gift-value.js';
|
|
133
|
+
export { getStarGiftWithdrawalUrl } from './methods/gifts/get-star-gift-withdrawal-url.js';
|
|
134
|
+
export { getUniqueStarGift } from './methods/gifts/get-unique-star-gift.js';
|
|
135
|
+
export { iterSavedStarGifts } from './methods/gifts/iter-saved-star-gifts.js';
|
|
136
|
+
export { togglePinnedStarGifts } from './methods/gifts/pin-star-gift.js';
|
|
137
|
+
export { prepayStarGiftUpgrade } from './methods/gifts/prepay-star-gift-upgrade.js';
|
|
138
|
+
export { resolveStarGiftOffer } from './methods/gifts/resolve-star-gift-offer.js';
|
|
139
|
+
export { sendStarGiftOffer } from './methods/gifts/send-star-gift-offer.js';
|
|
140
|
+
export { sendStarGift } from './methods/gifts/send-star-gift.js';
|
|
141
|
+
export { setResaleStarGiftPrice } from './methods/gifts/set-gift-resale-price.js';
|
|
142
|
+
export { transferStarGift } from './methods/gifts/transfer-star-gift.js';
|
|
143
|
+
export { upgradeStarGift } from './methods/gifts/upgrade-star-gift.js';
|
|
122
144
|
export { createInviteLink } from './methods/invite-links/create-invite-link.js';
|
|
123
145
|
export { editInviteLink } from './methods/invite-links/edit-invite-link.js';
|
|
124
146
|
export { exportInviteLink } from './methods/invite-links/export-invite-link.js';
|
|
@@ -218,10 +240,8 @@ export { verifyPasswordEmail } from './methods/password/password-email.js';
|
|
|
218
240
|
export { resendPasswordEmail } from './methods/password/password-email.js';
|
|
219
241
|
export { cancelPasswordEmail } from './methods/password/password-email.js';
|
|
220
242
|
export { removeCloudPassword } from './methods/password/remove-cloud-password.js';
|
|
221
|
-
export {
|
|
222
|
-
export { acceptStarGift } from './methods/premium/accept-star-gift.js';
|
|
243
|
+
export type { InputStarsAmount } from './methods/premium/_normalize-stars-amount.js';
|
|
223
244
|
export { applyBoost } from './methods/premium/apply-boost.js';
|
|
224
|
-
export { buyResaleGift } from './methods/premium/buy-resale-gift.js';
|
|
225
245
|
export { canApplyBoost } from './methods/premium/can-apply-boost.js';
|
|
226
246
|
export type { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
|
|
227
247
|
export { createBusinessChatLink } from './methods/premium/create-business-chat-link.js';
|
|
@@ -232,26 +252,11 @@ export { getBoosts } from './methods/premium/get-boosts.js';
|
|
|
232
252
|
export { getBusinessChatLinks } from './methods/premium/get-business-chat-links.js';
|
|
233
253
|
export { getBusinessConnection } from './methods/premium/get-business-connection.js';
|
|
234
254
|
export { getMyBoostSlots } from './methods/premium/get-my-boost-slots.js';
|
|
235
|
-
export { getStarGiftResaleOptions } from './methods/premium/get-resale-star-gifts.js';
|
|
236
|
-
export type { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/premium/get-resale-star-gifts.js';
|
|
237
|
-
export { getSavedStarGiftsById } from './methods/premium/get-saved-star-gifts-by-id.js';
|
|
238
|
-
export { getSavedStarGifts } from './methods/premium/get-saved-star-gifts.js';
|
|
239
|
-
export { getStarGiftOptions } from './methods/premium/get-star-gift-options.js';
|
|
240
|
-
export { getStarGiftValue } from './methods/premium/get-star-gift-value.js';
|
|
241
|
-
export { getStarGiftWithdrawalUrl } from './methods/premium/get-star-gift-withdrawal-url.js';
|
|
242
255
|
export { getStarsTransactions } from './methods/premium/get-stars-transactions.js';
|
|
243
|
-
export { getUniqueStarGift } from './methods/premium/get-unique-star-gift.js';
|
|
244
256
|
export { iterBoosters } from './methods/premium/iter-boosters.js';
|
|
245
|
-
export { iterSavedStarGifts } from './methods/premium/iter-saved-star-gifts.js';
|
|
246
257
|
export { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js';
|
|
247
|
-
export { togglePinnedStarGifts } from './methods/premium/pin-star-gift.js';
|
|
248
|
-
export { prepayStarGiftUpgrade } from './methods/premium/prepay-star-gift-upgrade.js';
|
|
249
|
-
export { sendStarGift } from './methods/premium/send-star-gift.js';
|
|
250
258
|
export { setBusinessIntro } from './methods/premium/set-business-intro.js';
|
|
251
259
|
export { setBusinessWorkHours } from './methods/premium/set-business-work-hours.js';
|
|
252
|
-
export { setResaleStarGiftPrice } from './methods/premium/set-gift-resale-price.js';
|
|
253
|
-
export { transferStarGift } from './methods/premium/transfer-star-gift.js';
|
|
254
|
-
export { upgradeStarGift } from './methods/premium/upgrade-star-gift.js';
|
|
255
260
|
export { addStickerToSet } from './methods/stickers/add-sticker-to-set.js';
|
|
256
261
|
export { createStickerSet } from './methods/stickers/create-sticker-set.js';
|
|
257
262
|
export { deleteStickerFromSet } from './methods/stickers/delete-sticker-from-set.js';
|
package/highlevel/methods.d.ts
CHANGED
|
@@ -119,6 +119,28 @@ export { toggleForumTopicClosed } from './methods/forums/toggle-forum-topic-clos
|
|
|
119
119
|
export { toggleForumTopicPinned } from './methods/forums/toggle-forum-topic-pinned.js';
|
|
120
120
|
export { updateForumSettings } from './methods/forums/toggle-forum.js';
|
|
121
121
|
export { toggleGeneralTopicHidden } from './methods/forums/toggle-general-topic-hidden.js';
|
|
122
|
+
export { _normalizeInputStarGift } from './methods/gifts/_normalize-input-star-gift.js';
|
|
123
|
+
export { acceptStarGift } from './methods/gifts/accept-star-gift.js';
|
|
124
|
+
export { buyResaleGift } from './methods/gifts/buy-resale-gift.js';
|
|
125
|
+
export { getStarGiftResaleOptions } from './methods/gifts/get-resale-star-gifts.js';
|
|
126
|
+
export type { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/gifts/get-resale-star-gifts.js';
|
|
127
|
+
export { getSavedStarGiftsById } from './methods/gifts/get-saved-star-gifts-by-id.js';
|
|
128
|
+
export { getSavedStarGifts } from './methods/gifts/get-saved-star-gifts.js';
|
|
129
|
+
export { getStarGiftOptions } from './methods/gifts/get-star-gift-options.js';
|
|
130
|
+
export { getStarGiftUpgradeOptions } from './methods/gifts/get-star-gift-upgrade-options.js';
|
|
131
|
+
export type { StarGiftUpgradeOptions } from './methods/gifts/get-star-gift-upgrade-options.js';
|
|
132
|
+
export { getStarGiftValue } from './methods/gifts/get-star-gift-value.js';
|
|
133
|
+
export { getStarGiftWithdrawalUrl } from './methods/gifts/get-star-gift-withdrawal-url.js';
|
|
134
|
+
export { getUniqueStarGift } from './methods/gifts/get-unique-star-gift.js';
|
|
135
|
+
export { iterSavedStarGifts } from './methods/gifts/iter-saved-star-gifts.js';
|
|
136
|
+
export { togglePinnedStarGifts } from './methods/gifts/pin-star-gift.js';
|
|
137
|
+
export { prepayStarGiftUpgrade } from './methods/gifts/prepay-star-gift-upgrade.js';
|
|
138
|
+
export { resolveStarGiftOffer } from './methods/gifts/resolve-star-gift-offer.js';
|
|
139
|
+
export { sendStarGiftOffer } from './methods/gifts/send-star-gift-offer.js';
|
|
140
|
+
export { sendStarGift } from './methods/gifts/send-star-gift.js';
|
|
141
|
+
export { setResaleStarGiftPrice } from './methods/gifts/set-gift-resale-price.js';
|
|
142
|
+
export { transferStarGift } from './methods/gifts/transfer-star-gift.js';
|
|
143
|
+
export { upgradeStarGift } from './methods/gifts/upgrade-star-gift.js';
|
|
122
144
|
export { createInviteLink } from './methods/invite-links/create-invite-link.js';
|
|
123
145
|
export { editInviteLink } from './methods/invite-links/edit-invite-link.js';
|
|
124
146
|
export { exportInviteLink } from './methods/invite-links/export-invite-link.js';
|
|
@@ -218,10 +240,8 @@ export { verifyPasswordEmail } from './methods/password/password-email.js';
|
|
|
218
240
|
export { resendPasswordEmail } from './methods/password/password-email.js';
|
|
219
241
|
export { cancelPasswordEmail } from './methods/password/password-email.js';
|
|
220
242
|
export { removeCloudPassword } from './methods/password/remove-cloud-password.js';
|
|
221
|
-
export {
|
|
222
|
-
export { acceptStarGift } from './methods/premium/accept-star-gift.js';
|
|
243
|
+
export type { InputStarsAmount } from './methods/premium/_normalize-stars-amount.js';
|
|
223
244
|
export { applyBoost } from './methods/premium/apply-boost.js';
|
|
224
|
-
export { buyResaleGift } from './methods/premium/buy-resale-gift.js';
|
|
225
245
|
export { canApplyBoost } from './methods/premium/can-apply-boost.js';
|
|
226
246
|
export type { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
|
|
227
247
|
export { createBusinessChatLink } from './methods/premium/create-business-chat-link.js';
|
|
@@ -232,26 +252,11 @@ export { getBoosts } from './methods/premium/get-boosts.js';
|
|
|
232
252
|
export { getBusinessChatLinks } from './methods/premium/get-business-chat-links.js';
|
|
233
253
|
export { getBusinessConnection } from './methods/premium/get-business-connection.js';
|
|
234
254
|
export { getMyBoostSlots } from './methods/premium/get-my-boost-slots.js';
|
|
235
|
-
export { getStarGiftResaleOptions } from './methods/premium/get-resale-star-gifts.js';
|
|
236
|
-
export type { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/premium/get-resale-star-gifts.js';
|
|
237
|
-
export { getSavedStarGiftsById } from './methods/premium/get-saved-star-gifts-by-id.js';
|
|
238
|
-
export { getSavedStarGifts } from './methods/premium/get-saved-star-gifts.js';
|
|
239
|
-
export { getStarGiftOptions } from './methods/premium/get-star-gift-options.js';
|
|
240
|
-
export { getStarGiftValue } from './methods/premium/get-star-gift-value.js';
|
|
241
|
-
export { getStarGiftWithdrawalUrl } from './methods/premium/get-star-gift-withdrawal-url.js';
|
|
242
255
|
export { getStarsTransactions } from './methods/premium/get-stars-transactions.js';
|
|
243
|
-
export { getUniqueStarGift } from './methods/premium/get-unique-star-gift.js';
|
|
244
256
|
export { iterBoosters } from './methods/premium/iter-boosters.js';
|
|
245
|
-
export { iterSavedStarGifts } from './methods/premium/iter-saved-star-gifts.js';
|
|
246
257
|
export { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js';
|
|
247
|
-
export { togglePinnedStarGifts } from './methods/premium/pin-star-gift.js';
|
|
248
|
-
export { prepayStarGiftUpgrade } from './methods/premium/prepay-star-gift-upgrade.js';
|
|
249
|
-
export { sendStarGift } from './methods/premium/send-star-gift.js';
|
|
250
258
|
export { setBusinessIntro } from './methods/premium/set-business-intro.js';
|
|
251
259
|
export { setBusinessWorkHours } from './methods/premium/set-business-work-hours.js';
|
|
252
|
-
export { setResaleStarGiftPrice } from './methods/premium/set-gift-resale-price.js';
|
|
253
|
-
export { transferStarGift } from './methods/premium/transfer-star-gift.js';
|
|
254
|
-
export { upgradeStarGift } from './methods/premium/upgrade-star-gift.js';
|
|
255
260
|
export { addStickerToSet } from './methods/stickers/add-sticker-to-set.js';
|
|
256
261
|
export { createStickerSet } from './methods/stickers/create-sticker-set.js';
|
|
257
262
|
export { deleteStickerFromSet } from './methods/stickers/delete-sticker-from-set.js';
|
|
@@ -28,7 +28,7 @@ function parseDocument(doc, media) {
|
|
|
28
28
|
switch (attr._) {
|
|
29
29
|
case "documentAttributeAudio":
|
|
30
30
|
if (attr.voice) {
|
|
31
|
-
return new voice.Voice(doc, attr);
|
|
31
|
+
return new voice.Voice(doc, attr, media);
|
|
32
32
|
}
|
|
33
33
|
return new audio.Audio(doc, attr);
|
|
34
34
|
case "documentAttributeVideo":
|
|
@@ -21,7 +21,7 @@ function parseDocument(doc, media) {
|
|
|
21
21
|
switch (attr._) {
|
|
22
22
|
case "documentAttributeAudio":
|
|
23
23
|
if (attr.voice) {
|
|
24
|
-
return new Voice$2(doc, attr);
|
|
24
|
+
return new Voice$2(doc, attr, media);
|
|
25
25
|
}
|
|
26
26
|
return new Audio$2(doc, attr);
|
|
27
27
|
case "documentAttributeVideo":
|
|
@@ -11,9 +11,10 @@ const voiceUtils = require("../../utils/voice-utils.cjs");
|
|
|
11
11
|
const document = require("./document.cjs");
|
|
12
12
|
const inspectable = require("../../utils/inspectable.cjs");
|
|
13
13
|
class Voice extends document.RawDocument {
|
|
14
|
-
constructor(doc, attr) {
|
|
14
|
+
constructor(doc, attr, media) {
|
|
15
15
|
super(doc);
|
|
16
16
|
this.attr = attr;
|
|
17
|
+
this.media = media;
|
|
17
18
|
}
|
|
18
19
|
type = "voice";
|
|
19
20
|
_fileIdType() {
|
|
@@ -34,6 +35,10 @@ class Voice extends document.RawDocument {
|
|
|
34
35
|
get waveform() {
|
|
35
36
|
return voiceUtils.decodeWaveform(this.attr.waveform);
|
|
36
37
|
}
|
|
38
|
+
/** For self-destructing voice notes, TTL in seconds */
|
|
39
|
+
get ttlSeconds() {
|
|
40
|
+
return this.media?.ttlSeconds ?? null;
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
const Voice$1 = /* @__PURE__ */ memoize.memoizeGetters(Voice, ["fileName", "thumbnails", "fileId", "uniqueFileId", "waveform"]);
|
|
39
44
|
const Voice$2 = /* @__PURE__ */ inspectable.makeInspectable(Voice$1, ["fileSize", "dcId"], ["inputMedia", "inputDocument", "waveform"]);
|
|
@@ -6,9 +6,10 @@ import { RawDocument } from './document.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Voice extends RawDocument {
|
|
8
8
|
readonly attr: tl.RawDocumentAttributeAudio;
|
|
9
|
+
readonly media?: tl.RawMessageMediaDocument | undefined;
|
|
9
10
|
readonly type: "voice";
|
|
10
11
|
protected _fileIdType(): tdFileId.FileType;
|
|
11
|
-
constructor(doc: tl.RawDocument, attr: tl.RawDocumentAttributeAudio);
|
|
12
|
+
constructor(doc: tl.RawDocument, attr: tl.RawDocumentAttributeAudio, media?: tl.RawMessageMediaDocument | undefined);
|
|
12
13
|
/**
|
|
13
14
|
* Duration of the voice note in seconds.
|
|
14
15
|
*/
|
|
@@ -20,4 +21,6 @@ export declare class Voice extends RawDocument {
|
|
|
20
21
|
* usually has length of 100
|
|
21
22
|
*/
|
|
22
23
|
get waveform(): number[];
|
|
24
|
+
/** For self-destructing voice notes, TTL in seconds */
|
|
25
|
+
get ttlSeconds(): number | null;
|
|
23
26
|
}
|
|
@@ -6,9 +6,10 @@ import { RawDocument } from './document.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Voice extends RawDocument {
|
|
8
8
|
readonly attr: tl.RawDocumentAttributeAudio;
|
|
9
|
+
readonly media?: tl.RawMessageMediaDocument | undefined;
|
|
9
10
|
readonly type: "voice";
|
|
10
11
|
protected _fileIdType(): tdFileId.FileType;
|
|
11
|
-
constructor(doc: tl.RawDocument, attr: tl.RawDocumentAttributeAudio);
|
|
12
|
+
constructor(doc: tl.RawDocument, attr: tl.RawDocumentAttributeAudio, media?: tl.RawMessageMediaDocument | undefined);
|
|
12
13
|
/**
|
|
13
14
|
* Duration of the voice note in seconds.
|
|
14
15
|
*/
|
|
@@ -20,4 +21,6 @@ export declare class Voice extends RawDocument {
|
|
|
20
21
|
* usually has length of 100
|
|
21
22
|
*/
|
|
22
23
|
get waveform(): number[];
|
|
24
|
+
/** For self-destructing voice notes, TTL in seconds */
|
|
25
|
+
get ttlSeconds(): number | null;
|
|
23
26
|
}
|
|
@@ -4,9 +4,10 @@ import { decodeWaveform } from "../../utils/voice-utils.js";
|
|
|
4
4
|
import { RawDocument } from "./document.js";
|
|
5
5
|
import { makeInspectable } from "../../utils/inspectable.js";
|
|
6
6
|
class Voice extends RawDocument {
|
|
7
|
-
constructor(doc, attr) {
|
|
7
|
+
constructor(doc, attr, media) {
|
|
8
8
|
super(doc);
|
|
9
9
|
this.attr = attr;
|
|
10
|
+
this.media = media;
|
|
10
11
|
}
|
|
11
12
|
type = "voice";
|
|
12
13
|
_fileIdType() {
|
|
@@ -27,6 +28,10 @@ class Voice extends RawDocument {
|
|
|
27
28
|
get waveform() {
|
|
28
29
|
return decodeWaveform(this.attr.waveform);
|
|
29
30
|
}
|
|
31
|
+
/** For self-destructing voice notes, TTL in seconds */
|
|
32
|
+
get ttlSeconds() {
|
|
33
|
+
return this.media?.ttlSeconds ?? null;
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
const Voice$1 = /* @__PURE__ */ memoizeGetters(Voice, ["fileName", "thumbnails", "fileId", "uniqueFileId", "waveform"]);
|
|
32
37
|
const Voice$2 = /* @__PURE__ */ makeInspectable(Voice$1, ["fileSize", "dcId"], ["inputMedia", "inputDocument", "waveform"]);
|
|
@@ -5,7 +5,6 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
-
const utils = require("@fuman/utils");
|
|
9
8
|
const Long = require("long");
|
|
10
9
|
const peerUtils = require("../../../utils/peer-utils.cjs");
|
|
11
10
|
const photo = require("../media/photo.cjs");
|
|
@@ -185,7 +184,7 @@ function _messageActionFromTl(act) {
|
|
|
185
184
|
};
|
|
186
185
|
case "messageActionSetChatTheme":
|
|
187
186
|
if (act.theme._ === "chatThemeUniqueGift") {
|
|
188
|
-
|
|
187
|
+
if (act.theme.gift._ !== "starGiftUnique") return null;
|
|
189
188
|
return {
|
|
190
189
|
type: "theme_changed_unique",
|
|
191
190
|
gift: new starGiftUnique.StarGiftUnique(act.theme.gift, this._peers),
|
|
@@ -296,7 +295,7 @@ function _messageActionFromTl(act) {
|
|
|
296
295
|
giveawayMessageId: act.giveawayMsgId
|
|
297
296
|
};
|
|
298
297
|
case "messageActionStarGift":
|
|
299
|
-
|
|
298
|
+
if (act.gift._ !== "starGift") return null;
|
|
300
299
|
if (act.prepaidUpgrade) {
|
|
301
300
|
return {
|
|
302
301
|
type: "star_gift_upgrade_paid",
|
|
@@ -319,12 +318,13 @@ function _messageActionFromTl(act) {
|
|
|
319
318
|
upgradeStars: act.upgradeStars ?? Long.ZERO,
|
|
320
319
|
upgradeMsgId: act.upgradeMsgId ?? null,
|
|
321
320
|
fromAuction: act.auctionAcquired,
|
|
321
|
+
giftNum: act.giftNum,
|
|
322
322
|
toId: act.toId ? peer.parsePeer(act.toId, this._peers) : null,
|
|
323
323
|
savedId: act.savedId,
|
|
324
324
|
prepaidUpgradeHash: act.prepaidUpgradeHash ?? void 0
|
|
325
325
|
};
|
|
326
326
|
case "messageActionStarGiftUnique": {
|
|
327
|
-
|
|
327
|
+
if (act.gift._ !== "starGiftUnique") return null;
|
|
328
328
|
const common = {
|
|
329
329
|
saved: act.saved,
|
|
330
330
|
refunded: act.refunded,
|
|
@@ -341,6 +341,12 @@ function _messageActionFromTl(act) {
|
|
|
341
341
|
...common
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
+
if (act.fromOffer) {
|
|
345
|
+
return {
|
|
346
|
+
type: "star_gift_bought_offer",
|
|
347
|
+
...common
|
|
348
|
+
};
|
|
349
|
+
}
|
|
344
350
|
if (act.resaleAmount) {
|
|
345
351
|
return {
|
|
346
352
|
type: "star_gift_bought_resale",
|
|
@@ -395,6 +401,23 @@ function _messageActionFromTl(act) {
|
|
|
395
401
|
type: "suggest_birthday",
|
|
396
402
|
birthday: act.birthday
|
|
397
403
|
};
|
|
404
|
+
case "messageActionStarGiftPurchaseOffer":
|
|
405
|
+
if (act.gift._ !== "starGiftUnique") return null;
|
|
406
|
+
return {
|
|
407
|
+
type: "star_gift_purchase_offer",
|
|
408
|
+
status: act.accepted ? "accepted" : act.declined ? "declined" : "pending",
|
|
409
|
+
gift: new starGiftUnique.StarGiftUnique(act.gift, this._peers),
|
|
410
|
+
price: act.price,
|
|
411
|
+
expiresAt: new Date(act.expiresAt * 1e3)
|
|
412
|
+
};
|
|
413
|
+
case "messageActionStarGiftPurchaseOfferDeclined":
|
|
414
|
+
if (act.gift._ !== "starGiftUnique") return null;
|
|
415
|
+
return {
|
|
416
|
+
type: "star_gift_purchase_offer_declined",
|
|
417
|
+
expired: act.expired,
|
|
418
|
+
gift: new starGiftUnique.StarGiftUnique(act.gift, this._peers),
|
|
419
|
+
price: act.price
|
|
420
|
+
};
|
|
398
421
|
default:
|
|
399
422
|
return null;
|
|
400
423
|
}
|
|
@@ -437,6 +437,8 @@ export interface ActionStarGiftSent {
|
|
|
437
437
|
upgradeMsgId: number | null;
|
|
438
438
|
/** Whether this gift was purchased on an auction */
|
|
439
439
|
fromAuction: boolean;
|
|
440
|
+
/** For limited-offer gifts, the sequential number of the gift */
|
|
441
|
+
giftNum?: number;
|
|
440
442
|
/** Recipient of the gift */
|
|
441
443
|
toId: Peer | null;
|
|
442
444
|
/** ID of the related saved profile gift */
|
|
@@ -482,6 +484,31 @@ export interface ActionStarGiftBoughtResale extends StarGiftUniqueCommon {
|
|
|
482
484
|
/** Number of stars/TON that were paid for the gift */
|
|
483
485
|
amount: tl.TypeStarsAmount;
|
|
484
486
|
}
|
|
487
|
+
/** A star gift was bought from a purchase offer */
|
|
488
|
+
export interface ActionStarGiftBoughtOffer extends StarGiftUniqueCommon {
|
|
489
|
+
readonly type: 'star_gift_bought_offer';
|
|
490
|
+
}
|
|
491
|
+
/** A purchase offer was created for one of the user's star gifts */
|
|
492
|
+
export interface ActionStarGiftPurchaseOffer {
|
|
493
|
+
readonly type: 'star_gift_purchase_offer';
|
|
494
|
+
/** Current status of the offer */
|
|
495
|
+
status: 'pending' | 'accepted' | 'declined';
|
|
496
|
+
/** Star gift */
|
|
497
|
+
gift: StarGiftUnique;
|
|
498
|
+
/** The amount of money that was offered for the gift */
|
|
499
|
+
price: tl.TypeStarsAmount;
|
|
500
|
+
/** Date when the offer will expire */
|
|
501
|
+
expiresAt: Date;
|
|
502
|
+
}
|
|
503
|
+
/** A purchase offer was declined or expired */
|
|
504
|
+
export interface ActionStarGiftPurchaseOfferDeclined {
|
|
505
|
+
readonly type: 'star_gift_purchase_offer_declined';
|
|
506
|
+
/** Whether the offer was auto-declined due to expiration */
|
|
507
|
+
expired: boolean;
|
|
508
|
+
gift: StarGiftUnique;
|
|
509
|
+
/** The amount of money refunded to the user who created the offer */
|
|
510
|
+
price: tl.TypeStarsAmount;
|
|
511
|
+
}
|
|
485
512
|
/** A star gift previously exported to the blockchain was assigned to your profile */
|
|
486
513
|
export interface ActionStarGiftAssigned extends StarGiftUniqueCommon {
|
|
487
514
|
readonly type: 'star_gift_assigned';
|
|
@@ -539,7 +566,7 @@ export interface ActionSuggestBirthday {
|
|
|
539
566
|
/** Birthday */
|
|
540
567
|
birthday: tl.RawBirthday;
|
|
541
568
|
}
|
|
542
|
-
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | null;
|
|
569
|
+
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | null;
|
|
543
570
|
/** @internal */
|
|
544
571
|
export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
|
|
545
572
|
export {};
|
|
@@ -437,6 +437,8 @@ export interface ActionStarGiftSent {
|
|
|
437
437
|
upgradeMsgId: number | null;
|
|
438
438
|
/** Whether this gift was purchased on an auction */
|
|
439
439
|
fromAuction: boolean;
|
|
440
|
+
/** For limited-offer gifts, the sequential number of the gift */
|
|
441
|
+
giftNum?: number;
|
|
440
442
|
/** Recipient of the gift */
|
|
441
443
|
toId: Peer | null;
|
|
442
444
|
/** ID of the related saved profile gift */
|
|
@@ -482,6 +484,31 @@ export interface ActionStarGiftBoughtResale extends StarGiftUniqueCommon {
|
|
|
482
484
|
/** Number of stars/TON that were paid for the gift */
|
|
483
485
|
amount: tl.TypeStarsAmount;
|
|
484
486
|
}
|
|
487
|
+
/** A star gift was bought from a purchase offer */
|
|
488
|
+
export interface ActionStarGiftBoughtOffer extends StarGiftUniqueCommon {
|
|
489
|
+
readonly type: 'star_gift_bought_offer';
|
|
490
|
+
}
|
|
491
|
+
/** A purchase offer was created for one of the user's star gifts */
|
|
492
|
+
export interface ActionStarGiftPurchaseOffer {
|
|
493
|
+
readonly type: 'star_gift_purchase_offer';
|
|
494
|
+
/** Current status of the offer */
|
|
495
|
+
status: 'pending' | 'accepted' | 'declined';
|
|
496
|
+
/** Star gift */
|
|
497
|
+
gift: StarGiftUnique;
|
|
498
|
+
/** The amount of money that was offered for the gift */
|
|
499
|
+
price: tl.TypeStarsAmount;
|
|
500
|
+
/** Date when the offer will expire */
|
|
501
|
+
expiresAt: Date;
|
|
502
|
+
}
|
|
503
|
+
/** A purchase offer was declined or expired */
|
|
504
|
+
export interface ActionStarGiftPurchaseOfferDeclined {
|
|
505
|
+
readonly type: 'star_gift_purchase_offer_declined';
|
|
506
|
+
/** Whether the offer was auto-declined due to expiration */
|
|
507
|
+
expired: boolean;
|
|
508
|
+
gift: StarGiftUnique;
|
|
509
|
+
/** The amount of money refunded to the user who created the offer */
|
|
510
|
+
price: tl.TypeStarsAmount;
|
|
511
|
+
}
|
|
485
512
|
/** A star gift previously exported to the blockchain was assigned to your profile */
|
|
486
513
|
export interface ActionStarGiftAssigned extends StarGiftUniqueCommon {
|
|
487
514
|
readonly type: 'star_gift_assigned';
|
|
@@ -539,7 +566,7 @@ export interface ActionSuggestBirthday {
|
|
|
539
566
|
/** Birthday */
|
|
540
567
|
birthday: tl.RawBirthday;
|
|
541
568
|
}
|
|
542
|
-
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | null;
|
|
569
|
+
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | null;
|
|
543
570
|
/** @internal */
|
|
544
571
|
export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
|
|
545
572
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { assert } from "@fuman/utils";
|
|
2
1
|
import Long from "long";
|
|
3
2
|
import { getMarkedPeerId } from "../../../utils/peer-utils.js";
|
|
4
3
|
import { Photo as Photo$2 } from "../media/photo.js";
|
|
@@ -178,7 +177,7 @@ function _messageActionFromTl(act) {
|
|
|
178
177
|
};
|
|
179
178
|
case "messageActionSetChatTheme":
|
|
180
179
|
if (act.theme._ === "chatThemeUniqueGift") {
|
|
181
|
-
|
|
180
|
+
if (act.theme.gift._ !== "starGiftUnique") return null;
|
|
182
181
|
return {
|
|
183
182
|
type: "theme_changed_unique",
|
|
184
183
|
gift: new StarGiftUnique$2(act.theme.gift, this._peers),
|
|
@@ -289,7 +288,7 @@ function _messageActionFromTl(act) {
|
|
|
289
288
|
giveawayMessageId: act.giveawayMsgId
|
|
290
289
|
};
|
|
291
290
|
case "messageActionStarGift":
|
|
292
|
-
|
|
291
|
+
if (act.gift._ !== "starGift") return null;
|
|
293
292
|
if (act.prepaidUpgrade) {
|
|
294
293
|
return {
|
|
295
294
|
type: "star_gift_upgrade_paid",
|
|
@@ -312,12 +311,13 @@ function _messageActionFromTl(act) {
|
|
|
312
311
|
upgradeStars: act.upgradeStars ?? Long.ZERO,
|
|
313
312
|
upgradeMsgId: act.upgradeMsgId ?? null,
|
|
314
313
|
fromAuction: act.auctionAcquired,
|
|
314
|
+
giftNum: act.giftNum,
|
|
315
315
|
toId: act.toId ? parsePeer(act.toId, this._peers) : null,
|
|
316
316
|
savedId: act.savedId,
|
|
317
317
|
prepaidUpgradeHash: act.prepaidUpgradeHash ?? void 0
|
|
318
318
|
};
|
|
319
319
|
case "messageActionStarGiftUnique": {
|
|
320
|
-
|
|
320
|
+
if (act.gift._ !== "starGiftUnique") return null;
|
|
321
321
|
const common = {
|
|
322
322
|
saved: act.saved,
|
|
323
323
|
refunded: act.refunded,
|
|
@@ -334,6 +334,12 @@ function _messageActionFromTl(act) {
|
|
|
334
334
|
...common
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
+
if (act.fromOffer) {
|
|
338
|
+
return {
|
|
339
|
+
type: "star_gift_bought_offer",
|
|
340
|
+
...common
|
|
341
|
+
};
|
|
342
|
+
}
|
|
337
343
|
if (act.resaleAmount) {
|
|
338
344
|
return {
|
|
339
345
|
type: "star_gift_bought_resale",
|
|
@@ -388,6 +394,23 @@ function _messageActionFromTl(act) {
|
|
|
388
394
|
type: "suggest_birthday",
|
|
389
395
|
birthday: act.birthday
|
|
390
396
|
};
|
|
397
|
+
case "messageActionStarGiftPurchaseOffer":
|
|
398
|
+
if (act.gift._ !== "starGiftUnique") return null;
|
|
399
|
+
return {
|
|
400
|
+
type: "star_gift_purchase_offer",
|
|
401
|
+
status: act.accepted ? "accepted" : act.declined ? "declined" : "pending",
|
|
402
|
+
gift: new StarGiftUnique$2(act.gift, this._peers),
|
|
403
|
+
price: act.price,
|
|
404
|
+
expiresAt: new Date(act.expiresAt * 1e3)
|
|
405
|
+
};
|
|
406
|
+
case "messageActionStarGiftPurchaseOfferDeclined":
|
|
407
|
+
if (act.gift._ !== "starGiftUnique") return null;
|
|
408
|
+
return {
|
|
409
|
+
type: "star_gift_purchase_offer_declined",
|
|
410
|
+
expired: act.expired,
|
|
411
|
+
gift: new StarGiftUnique$2(act.gift, this._peers),
|
|
412
|
+
price: act.price
|
|
413
|
+
};
|
|
391
414
|
default:
|
|
392
415
|
return null;
|
|
393
416
|
}
|
|
@@ -100,6 +100,10 @@ class SavedStarGift {
|
|
|
100
100
|
get prepaidUpgradeHash() {
|
|
101
101
|
return this.raw.prepaidUpgradeHash ?? null;
|
|
102
102
|
}
|
|
103
|
+
/** Number of the gift for limited-offer gifts */
|
|
104
|
+
get giftNum() {
|
|
105
|
+
return this.raw.giftNum ?? null;
|
|
106
|
+
}
|
|
103
107
|
}
|
|
104
108
|
const SavedStarGift$1 = /* @__PURE__ */ inspectable.makeInspectable(SavedStarGift);
|
|
105
109
|
const SavedStarGift$2 = /* @__PURE__ */ memoize.memoizeGetters(SavedStarGift$1, ["sender", "gift"]);
|
|
@@ -50,4 +50,6 @@ export declare class SavedStarGift {
|
|
|
50
50
|
* If available, you can pay for this gift's upgrade by passing this hash to `prepayStarGiftUpgrade`
|
|
51
51
|
*/
|
|
52
52
|
get prepaidUpgradeHash(): string | null;
|
|
53
|
+
/** Number of the gift for limited-offer gifts */
|
|
54
|
+
get giftNum(): number | null;
|
|
53
55
|
}
|
|
@@ -50,4 +50,6 @@ export declare class SavedStarGift {
|
|
|
50
50
|
* If available, you can pay for this gift's upgrade by passing this hash to `prepayStarGiftUpgrade`
|
|
51
51
|
*/
|
|
52
52
|
get prepaidUpgradeHash(): string | null;
|
|
53
|
+
/** Number of the gift for limited-offer gifts */
|
|
54
|
+
get giftNum(): number | null;
|
|
53
55
|
}
|
|
@@ -93,6 +93,10 @@ class SavedStarGift {
|
|
|
93
93
|
get prepaidUpgradeHash() {
|
|
94
94
|
return this.raw.prepaidUpgradeHash ?? null;
|
|
95
95
|
}
|
|
96
|
+
/** Number of the gift for limited-offer gifts */
|
|
97
|
+
get giftNum() {
|
|
98
|
+
return this.raw.giftNum ?? null;
|
|
99
|
+
}
|
|
96
100
|
}
|
|
97
101
|
const SavedStarGift$1 = /* @__PURE__ */ makeInspectable(SavedStarGift);
|
|
98
102
|
const SavedStarGift$2 = /* @__PURE__ */ memoizeGetters(SavedStarGift$1, ["sender", "gift"]);
|
|
@@ -238,6 +238,14 @@ class StarGiftUnique {
|
|
|
238
238
|
if (!this.raw.releasedBy) return null;
|
|
239
239
|
return peer.parsePeer(this.raw.releasedBy, this._peers);
|
|
240
240
|
}
|
|
241
|
+
/** Value of the gift in USD */
|
|
242
|
+
get valueUsd() {
|
|
243
|
+
return this.raw.valueUsdAmount ?? null;
|
|
244
|
+
}
|
|
245
|
+
/** Minimum number of stars required to create a purchase offer for the gift */
|
|
246
|
+
get offerMinStars() {
|
|
247
|
+
return this.raw.offerMinStars ?? null;
|
|
248
|
+
}
|
|
241
249
|
}
|
|
242
250
|
const StarGiftUnique$1 = /* @__PURE__ */ inspectable.makeInspectable(StarGiftUnique);
|
|
243
251
|
const StarGiftUnique$2 = /* @__PURE__ */ memoize.memoizeGetters(StarGiftUnique$1, [
|
|
@@ -121,4 +121,8 @@ export declare class StarGiftUnique {
|
|
|
121
121
|
* User/channel who released this collection
|
|
122
122
|
*/
|
|
123
123
|
get releasedBy(): Peer | null;
|
|
124
|
+
/** Value of the gift in USD */
|
|
125
|
+
get valueUsd(): tl.Long | null;
|
|
126
|
+
/** Minimum number of stars required to create a purchase offer for the gift */
|
|
127
|
+
get offerMinStars(): number | null;
|
|
124
128
|
}
|
|
@@ -121,4 +121,8 @@ export declare class StarGiftUnique {
|
|
|
121
121
|
* User/channel who released this collection
|
|
122
122
|
*/
|
|
123
123
|
get releasedBy(): Peer | null;
|
|
124
|
+
/** Value of the gift in USD */
|
|
125
|
+
get valueUsd(): tl.Long | null;
|
|
126
|
+
/** Minimum number of stars required to create a purchase offer for the gift */
|
|
127
|
+
get offerMinStars(): number | null;
|
|
124
128
|
}
|
|
@@ -231,6 +231,14 @@ class StarGiftUnique {
|
|
|
231
231
|
if (!this.raw.releasedBy) return null;
|
|
232
232
|
return parsePeer(this.raw.releasedBy, this._peers);
|
|
233
233
|
}
|
|
234
|
+
/** Value of the gift in USD */
|
|
235
|
+
get valueUsd() {
|
|
236
|
+
return this.raw.valueUsdAmount ?? null;
|
|
237
|
+
}
|
|
238
|
+
/** Minimum number of stars required to create a purchase offer for the gift */
|
|
239
|
+
get offerMinStars() {
|
|
240
|
+
return this.raw.offerMinStars ?? null;
|
|
241
|
+
}
|
|
234
242
|
}
|
|
235
243
|
const StarGiftUnique$1 = /* @__PURE__ */ makeInspectable(StarGiftUnique);
|
|
236
244
|
const StarGiftUnique$2 = /* @__PURE__ */ memoizeGetters(StarGiftUnique$1, [
|
|
@@ -35,10 +35,11 @@ class StarGift {
|
|
|
35
35
|
}
|
|
36
36
|
/** If this gift is currently sold through an auction, info about that auction. `null` otherwise */
|
|
37
37
|
get auction() {
|
|
38
|
-
if (!this.raw.auctionSlug || this.raw.giftsPerRound == null) return null;
|
|
38
|
+
if (!this.raw.auctionSlug || this.raw.giftsPerRound == null || !this.raw.auctionStartDate) return null;
|
|
39
39
|
return {
|
|
40
40
|
slug: this.raw.auctionSlug,
|
|
41
|
-
giftsPerRound: this.raw.giftsPerRound
|
|
41
|
+
giftsPerRound: this.raw.giftsPerRound,
|
|
42
|
+
startDate: new Date(this.raw.auctionStartDate * 1e3)
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
/** @deprecated Use {@link auction} instead (typo in older versions) */
|
|
@@ -127,7 +128,15 @@ class StarGift {
|
|
|
127
128
|
if (!this.raw.releasedBy) return null;
|
|
128
129
|
return peer.parsePeer(this.raw.releasedBy, this._peers);
|
|
129
130
|
}
|
|
131
|
+
/** Number of unique upgrade variants that will be available for the gift */
|
|
132
|
+
get upgradeVariants() {
|
|
133
|
+
return this.raw.upgradeVariants ?? 0;
|
|
134
|
+
}
|
|
135
|
+
/** Background color of the gift */
|
|
136
|
+
get background() {
|
|
137
|
+
return this.raw.background ?? null;
|
|
138
|
+
}
|
|
130
139
|
}
|
|
131
140
|
const StarGift$1 = /* @__PURE__ */ inspectable.makeInspectable(StarGift);
|
|
132
|
-
const StarGift$2 = /* @__PURE__ */ memoize.memoizeGetters(StarGift$1, ["sticker"]);
|
|
141
|
+
const StarGift$2 = /* @__PURE__ */ memoize.memoizeGetters(StarGift$1, ["sticker", "auction"]);
|
|
133
142
|
exports.StarGift = StarGift$2;
|