diff --git a/src/api/gramjs/apiBuilders/appConfig.ts b/src/api/gramjs/apiBuilders/appConfig.ts index c01a7cd04..12321a380 100644 --- a/src/api/gramjs/apiBuilders/appConfig.ts +++ b/src/api/gramjs/apiBuilders/appConfig.ts @@ -95,6 +95,9 @@ export interface GramJsAppConfig extends LimitsConfig { freeze_since_date?: number; freeze_until_date?: number; freeze_appeal_url?: string; + stars_stargift_resale_amount_max?: number; + stars_stargift_resale_amount_min?: number; + stars_stargift_resale_commission_permille?: number; } function buildEmojiSounds(appConfig: GramJsAppConfig) { @@ -191,5 +194,8 @@ export function buildAppConfig(json: GramJs.TypeJSONValue, hash: number): ApiApp freezeSinceDate: appConfig.freeze_since_date, freezeUntilDate: appConfig.freeze_until_date, freezeAppealUrl: appConfig.freeze_appeal_url, + starsStargiftResaleAmountMin: appConfig.stars_stargift_resale_amount_min, + starsStargiftResaleAmountMax: appConfig.stars_stargift_resale_amount_max, + starsStargiftResaleCommissionPermille: appConfig.stars_stargift_resale_commission_permille, }; } diff --git a/src/api/gramjs/apiBuilders/calls.ts b/src/api/gramjs/apiBuilders/calls.ts index 3ac157919..624af1cfe 100644 --- a/src/api/gramjs/apiBuilders/calls.ts +++ b/src/api/gramjs/apiBuilders/calls.ts @@ -102,7 +102,8 @@ export function buildApiGroupCall(groupCall: GramJs.TypeGroupCall): ApiGroupCall } export function getGroupCallId(groupCall: GramJs.TypeInputGroupCall) { - return groupCall.id.toString(); + if (groupCall instanceof GramJs.InputGroupCall) return groupCall.id.toString(); + return undefined; } export function buildPhoneCall(call: GramJs.TypePhoneCall): ApiPhoneCall { diff --git a/src/api/gramjs/apiBuilders/gifts.ts b/src/api/gramjs/apiBuilders/gifts.ts index dd33c8083..5d5d6c30b 100644 --- a/src/api/gramjs/apiBuilders/gifts.ts +++ b/src/api/gramjs/apiBuilders/gifts.ts @@ -18,7 +18,7 @@ export function buildApiStarGift(starGift: GramJs.TypeStarGift): ApiStarGift { if (starGift instanceof GramJs.StarGiftUnique) { const { id, num, ownerId, ownerName, title, attributes, availabilityIssued, availabilityTotal, slug, ownerAddress, - giftAddress, + giftAddress, resellStars, } = starGift; return { @@ -34,12 +34,13 @@ export function buildApiStarGift(starGift: GramJs.TypeStarGift): ApiStarGift { issuedCount: availabilityIssued, slug, giftAddress, + resellPriceInStars: resellStars?.toJSNumber(), }; } const { id, limited, stars, availabilityRemains, availabilityTotal, convertStars, firstSaleDate, lastSaleDate, soldOut, - birthday, upgradeStars, + birthday, upgradeStars, resellMinStars, title, } = starGift; addDocumentToLocalDb(starGift.sticker); @@ -60,6 +61,8 @@ export function buildApiStarGift(starGift: GramJs.TypeStarGift): ApiStarGift { isSoldOut: soldOut, isBirthday: birthday, upgradeStars: upgradeStars?.toJSNumber(), + title, + resellMinStars: resellMinStars?.toJSNumber(), }; } @@ -132,7 +135,7 @@ export function buildApiStarGiftAttribute(attribute: GramJs.TypeStarGiftAttribut export function buildApiSavedStarGift(userStarGift: GramJs.SavedStarGift, peerId: string): ApiSavedStarGift { const { gift, date, convertStars, fromId, message, msgId, nameHidden, unsaved, upgradeStars, transferStars, canUpgrade, - savedId, canExportAt, pinnedToTop, + savedId, canExportAt, pinnedToTop, canResellAt, canTransferAt, } = userStarGift; const inputGift: ApiInputSavedStarGift | undefined = savedId && peerId @@ -154,6 +157,8 @@ export function buildApiSavedStarGift(userStarGift: GramJs.SavedStarGift, peerId inputGift, savedId: savedId?.toString(), canExportAt, + canResellAt, + canTransferAt, isPinned: pinnedToTop, }; } diff --git a/src/api/gramjs/apiBuilders/messageActions.ts b/src/api/gramjs/apiBuilders/messageActions.ts index 08b5df9fa..d77ca5774 100644 --- a/src/api/gramjs/apiBuilders/messageActions.ts +++ b/src/api/gramjs/apiBuilders/messageActions.ts @@ -187,6 +187,9 @@ export function buildApiMessageAction(action: GramJs.TypeMessageAction): ApiMess } if (action instanceof GramJs.MessageActionGroupCall) { const { call, duration } = action; + if (!(call instanceof GramJs.InputGroupCall)) { + return UNSUPPORTED_ACTION; + } return { mediaType: 'action', type: 'groupCall', @@ -199,6 +202,9 @@ export function buildApiMessageAction(action: GramJs.TypeMessageAction): ApiMess } if (action instanceof GramJs.MessageActionInviteToGroupCall) { const { call, users } = action; + if (!(call instanceof GramJs.InputGroupCall)) { + return UNSUPPORTED_ACTION; + } return { mediaType: 'action', type: 'inviteToGroupCall', @@ -211,6 +217,9 @@ export function buildApiMessageAction(action: GramJs.TypeMessageAction): ApiMess } if (action instanceof GramJs.MessageActionGroupCallScheduled) { const { call, scheduleDate } = action; + if (!(call instanceof GramJs.InputGroupCall)) { + return UNSUPPORTED_ACTION; + } return { mediaType: 'action', type: 'groupCallScheduled', @@ -393,6 +402,7 @@ export function buildApiMessageAction(action: GramJs.TypeMessageAction): ApiMess if (action instanceof GramJs.MessageActionStarGiftUnique) { const { upgrade, transferred, saved, refunded, gift, canExportAt, transferStars, fromId, peer, savedId, + resaleStars, } = action; const starGift = buildApiStarGift(gift); @@ -411,6 +421,7 @@ export function buildApiMessageAction(action: GramJs.TypeMessageAction): ApiMess fromId: fromId && getApiChatIdFromMtpPeer(fromId), peerId: peer && getApiChatIdFromMtpPeer(peer), savedId: savedId && buildApiPeerId(savedId, 'user'), + resaleStars: resaleStars?.toJSNumber(), }; } if (action instanceof GramJs.MessageActionPaidMessagesPrice) { diff --git a/src/api/gramjs/apiBuilders/payments.ts b/src/api/gramjs/apiBuilders/payments.ts index 3ac4b68ed..f11319852 100644 --- a/src/api/gramjs/apiBuilders/payments.ts +++ b/src/api/gramjs/apiBuilders/payments.ts @@ -536,6 +536,7 @@ export function buildApiStarsTransaction(transaction: GramJs.StarsTransaction): const { date, id, peer, stars, description, photo, title, refund, extendedMedia, failed, msgId, pending, gift, reaction, subscriptionPeriod, stargift, giveawayPostId, starrefCommissionPermille, stargiftUpgrade, paidMessages, + stargiftResale, } = transaction; if (photo) { @@ -567,6 +568,7 @@ export function buildApiStarsTransaction(transaction: GramJs.StarsTransaction): giveawayPostId, starRefCommision, isGiftUpgrade: stargiftUpgrade, + isGiftResale: stargiftResale, paidMessages, }; } diff --git a/src/api/gramjs/gramjsBuilders/index.ts b/src/api/gramjs/gramjsBuilders/index.ts index d6aba1ff1..5719a12e0 100644 --- a/src/api/gramjs/gramjsBuilders/index.ts +++ b/src/api/gramjs/gramjsBuilders/index.ts @@ -687,6 +687,16 @@ export function buildInputInvoice(invoice: ApiRequestInputInvoice) { }); } + case 'stargiftResale': { + const { + peer, slug, + } = invoice; + return new GramJs.InputInvoiceStarGiftResale({ + toId: buildInputPeer(peer.id, peer.accessHash), + slug, + }); + } + case 'stargift': { const { peer, shouldHideName, giftId, message, shouldUpgrade, diff --git a/src/api/gramjs/methods/chats.ts b/src/api/gramjs/methods/chats.ts index 91b88cdb6..f21cbe1a8 100644 --- a/src/api/gramjs/methods/chats.ts +++ b/src/api/gramjs/methods/chats.ts @@ -543,6 +543,8 @@ async function getFullChatInfo(chatId: string): Promise buildApiChatFromPreview(chat)).filter(Boolean); + const groupCall = call instanceof GramJs.InputGroupCall ? call : undefined; + return { fullInfo: { ...(chatPhoto instanceof GramJs.Photo && { profilePhoto: buildApiPhoto(chatPhoto) }), @@ -552,7 +554,7 @@ async function getFullChatInfo(chatId: string): Promise \ No newline at end of file diff --git a/src/assets/font-icons/crown-wear-outline.svg b/src/assets/font-icons/crown-wear-outline.svg new file mode 100644 index 000000000..659240af3 --- /dev/null +++ b/src/assets/font-icons/crown-wear-outline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/font-icons/eye-crossed-outline.svg b/src/assets/font-icons/eye-crossed-outline.svg index 240e12ee6..184742538 100644 --- a/src/assets/font-icons/eye-crossed-outline.svg +++ b/src/assets/font-icons/eye-crossed-outline.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/font-icons/eye-outline.svg b/src/assets/font-icons/eye-outline.svg index 0ebb379d5..e3619399b 100644 --- a/src/assets/font-icons/eye-outline.svg +++ b/src/assets/font-icons/eye-outline.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/font-icons/link-badge.svg b/src/assets/font-icons/link-badge.svg index 934209e2e..cad871874 100644 --- a/src/assets/font-icons/link-badge.svg +++ b/src/assets/font-icons/link-badge.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/font-icons/sell-outline.svg b/src/assets/font-icons/sell-outline.svg new file mode 100644 index 000000000..b4303b4f7 --- /dev/null +++ b/src/assets/font-icons/sell-outline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/font-icons/sell.svg b/src/assets/font-icons/sell.svg new file mode 100644 index 000000000..f5a8278e0 --- /dev/null +++ b/src/assets/font-icons/sell.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/font-icons/unlist-outline.svg b/src/assets/font-icons/unlist-outline.svg new file mode 100644 index 000000000..8fc7e2c1e --- /dev/null +++ b/src/assets/font-icons/unlist-outline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/font-icons/unlist.svg b/src/assets/font-icons/unlist.svg new file mode 100644 index 000000000..df95fccf1 --- /dev/null +++ b/src/assets/font-icons/unlist.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/localization/fallback.strings b/src/assets/localization/fallback.strings index 24e37abdd..ec905802c 100644 --- a/src/assets/localization/fallback.strings +++ b/src/assets/localization/fallback.strings @@ -1485,6 +1485,7 @@ "GiftInfoWear" = "Wear"; "GiftInfoTakeOff" = "Take Off"; "GiftInfoTransfer" = "Transfer"; +"GiftInfoUnlist" = "Unlist"; "GiftTransferTitle" = "Transfer"; "GiftTransferTON" = "Send via Blockchain"; "GiftTransferTONBlocked" = "unlocks in {time}"; @@ -1953,5 +1954,25 @@ "ApiMessageActionPaidMessagesRefundedIncoming" = "{user} refunded **{stars}** to you"; "NotificationTitleNotSupportedInFrozenAccount" = "Your account is frozen"; "NotificationMessageNotSupportedInFrozenAccount" = "This action is not available"; +"NotificationGiftIsSale" = "{gift} is now for sale!"; +"NotificationGiftIsUnlist" = "{gift} is removed from sale."; +"GiftRibbonSale" = "sale"; +"ButtonBuyGift" = "Buy for {stars}"; +"GiftInfoBuyGift" = "{user} is selling this gift and you can buy it."; +"StarsGiftBought"= "You bought gift!"; +"ButtonSellGift" = "Sell for {stars}"; +"GiftSellTitle" = "Sell Gift"; +"Sell" = "Sell"; +"InputPlaceholderGiftResalePrice" = "Enter Price"; +"DescriptionComposerGiftResalePrice" = "You will receive **{stars}**."; +"DescriptionComposerGiftMinimumPrice" = "Minimum price is **{stars}**."; +"ApiMessageMessageActionResaleStarGiftUniqueOutgoing" = "You paid {stars} for {gift}"; +"ApiMessageMessageActionResaleStarGiftUniqueIncoming" = "You received {stars} from selling {gift}"; +"ModalStarsBalanceBarDescription" = "Your balance is **{stars}**"; +"NotificationGiftCanResellAt" = "You will be able to resell this gift on {date}."; +"NotificationGiftCanTransferAt" = "You can transfer this gift after {date}."; +"StarGiftSaleTransaction" = "Gift Purchase"; +"StarGiftPurchaseTransaction" = "Gift Sale"; +"GiftBuyConfirmDescription" = "Do you want to buy **{gift}** for **{stars}**?"; "ComposerTitleForwardFrom" = "From: **{users}**"; "ContextMenuItemMention" = "Mention"; diff --git a/src/bundles/stars.ts b/src/bundles/stars.ts index 6adb938fb..e5fc157df 100644 --- a/src/bundles/stars.ts +++ b/src/bundles/stars.ts @@ -8,6 +8,7 @@ export { default as PaidReactionModal } from '../components/modals/paidReaction/ export { default as GiftModal } from '../components/modals/gift/GiftModal'; export { default as GiftRecipientPicker } from '../components/modals/gift/recipient/GiftRecipientPicker'; export { default as GiftInfoModal } from '../components/modals/gift/info/GiftInfoModal'; +export { default as GiftResalePriceComposerModal } from '../components/modals/gift/resale/GiftResalePriceComposerModal'; export { default as GiftUpgradeModal } from '../components/modals/gift/upgrade/GiftUpgradeModal'; export { default as GiftStatusInfoModal } from '../components/modals/gift/status/GiftStatusInfoModal'; export { default as GiftWithdrawModal } from '../components/modals/gift/withdraw/GiftWithdrawModal'; diff --git a/src/components/common/gift/GiftMenuItems.tsx b/src/components/common/gift/GiftMenuItems.tsx index b47b5730d..2f05a0e1f 100644 --- a/src/components/common/gift/GiftMenuItems.tsx +++ b/src/components/common/gift/GiftMenuItems.tsx @@ -7,9 +7,12 @@ import type { import { DEFAULT_STATUS_ICON_ID, TME_LINK_PREFIX } from '../../../config'; import { copyTextToClipboard } from '../../../util/clipboard'; +import { formatDateAtTime } from '../../../util/dates/dateFormat'; +import { getServerTime } from '../../../util/serverTime'; import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import MenuItem from '../../ui/MenuItem'; @@ -32,13 +35,17 @@ const GiftMenuItems = ({ showNotification, openChatWithDraft, openGiftTransferModal, + openGiftResalePriceComposerModal, openGiftStatusInfoModal, setEmojiStatus, toggleSavedGiftPinned, changeGiftVisibility, + updateStarGiftPrice, + closeGiftInfoModal, } = getActions(); const lang = useLang(); + const oldLang = useOldLang(); const isSavedGift = typeGift && 'gift' in typeGift; const savedGift = isSavedGift ? typeGift : undefined; @@ -62,6 +69,7 @@ const GiftMenuItems = ({ const isGiftUnique = gift && gift.type === 'starGiftUnique'; const canTakeOff = isGiftUnique && currenUniqueEmojiStatusSlug === gift.slug; const canWear = userCollectibleStatus && !canTakeOff; + const giftResalePrice = isGiftUnique ? gift.resellPriceInStars : undefined; const hasPinOptions = canManage && savedGift && !savedGift.isUnsaved && isGiftUnique; @@ -84,10 +92,48 @@ const GiftMenuItems = ({ }); const handleTransfer = useLastCallback(() => { - if (savedGift?.gift.type !== 'starGiftUnique') return; + if (!savedGift || savedGift?.gift.type !== 'starGiftUnique') return; + + if (savedGift.canTransferAt && savedGift.canTransferAt > getServerTime()) { + showNotification({ + message: { + key: 'NotificationGiftCanTransferAt', + variables: { date: formatDateAtTime(oldLang, savedGift.canTransferAt * 1000) }, + }, + }); + return; + } + openGiftTransferModal({ gift: savedGift }); }); + const handleSell = useLastCallback(() => { + if (!savedGift) return; + if (savedGift.canResellAt && savedGift.canResellAt > getServerTime()) { + showNotification({ + message: { + key: 'NotificationGiftCanResellAt', + variables: { date: formatDateAtTime(oldLang, savedGift.canResellAt * 1000) }, + }, + }); + return; + } + openGiftResalePriceComposerModal({ peerId, gift: savedGift }); + }); + + const handleUnsell = useLastCallback(() => { + if (!savedGift || savedGift.gift.type !== 'starGiftUnique' || !savedGift.inputGift) return; + closeGiftInfoModal(); + updateStarGiftPrice({ gift: savedGift.inputGift, price: 0 }); + showNotification({ + icon: 'unlist-outline', + message: { + key: 'NotificationGiftIsUnlist', + variables: { gift: lang('GiftUnique', { title: savedGift.gift.title, number: savedGift.gift.number }) }, + }, + }); + }); + const handleWear = useLastCallback(() => { if (gift?.type !== 'starGiftUnique' || !userCollectibleStatus) return; openGiftStatusInfoModal({ emojiStatus: userCollectibleStatus }); @@ -123,18 +169,28 @@ const GiftMenuItems = ({ {lang('GiftInfoTransfer')} )} + {canManage && isGiftUnique && !giftResalePrice && ( + + {lang('Sell')} + + )} + {canManage && isGiftUnique && giftResalePrice && ( + + {lang('GiftInfoUnlist')} + + )} {canManage && savedGift && ( {lang(savedGift.isUnsaved ? 'GiftActionShow' : 'GiftActionHide')} )} {canWear && ( - + {lang('GiftInfoWear')} )} {canTakeOff && ( - + {lang('GiftInfoTakeOff')} )} diff --git a/src/components/common/gift/GiftRibbon.tsx b/src/components/common/gift/GiftRibbon.tsx index 896f005e5..7d697e3ac 100644 --- a/src/components/common/gift/GiftRibbon.tsx +++ b/src/components/common/gift/GiftRibbon.tsx @@ -14,6 +14,7 @@ const COLORS = { red: [['#FF5B54', '#ED1C26'], ['#653633', '#532224']], blue: [['#6ED2FF', '#34A4FC'], ['#344F5A', '#152E42']], purple: [['#E367D7', '#757BF6'], ['#E367D7', '#757BF6']], + green: [['#52D553', '#4BB121'], ['#52D553', '#4BB121']], } as const; type ColorKey = keyof typeof COLORS; diff --git a/src/components/modals/gift/transfer/GiftTransferModal.module.scss b/src/components/common/gift/GiftTransferPreview.module.scss similarity index 97% rename from src/components/modals/gift/transfer/GiftTransferModal.module.scss rename to src/components/common/gift/GiftTransferPreview.module.scss index 257fe3841..f7c04932f 100644 --- a/src/components/modals/gift/transfer/GiftTransferModal.module.scss +++ b/src/components/common/gift/GiftTransferPreview.module.scss @@ -1,4 +1,4 @@ -.header { +.root { display: flex; justify-content: center; align-items: center; diff --git a/src/components/common/gift/GiftTransferPreview.tsx b/src/components/common/gift/GiftTransferPreview.tsx new file mode 100644 index 000000000..79f646ce2 --- /dev/null +++ b/src/components/common/gift/GiftTransferPreview.tsx @@ -0,0 +1,60 @@ +import React, { memo, useMemo } from '../../../lib/teact/teact'; + +import type { + ApiPeer, ApiStarGiftUnique, +} from '../../../api/types'; + +import { getGiftAttributes } from '../helpers/gifts'; +import { REM } from '../helpers/mediaDimensions'; + +import AnimatedIconFromSticker from '../AnimatedIconFromSticker'; +import Avatar from '../Avatar'; +import Icon from '../icons/Icon'; +import RadialPatternBackground from '../profile/RadialPatternBackground'; + +import styles from './GiftTransferPreview.module.scss'; + +type OwnProps = { + peer: ApiPeer; + gift: ApiStarGiftUnique; +}; + +const AVATAR_SIZE = 4 * REM; +const GIFT_STICKER_SIZE = 3 * REM; + +const GiftTransferPreview = ({ + peer, + gift, +}: OwnProps) => { + const giftAttributes = useMemo(() => { + return getGiftAttributes(gift); + }, [gift]); + + if (!giftAttributes) return undefined; + + return ( +
+
+ + +
+ + +
+ ); +}; + +export default memo(GiftTransferPreview); diff --git a/src/components/common/gift/SavedGift.tsx b/src/components/common/gift/SavedGift.tsx index 990cc1cd5..5df77fba9 100644 --- a/src/components/common/gift/SavedGift.tsx +++ b/src/components/common/gift/SavedGift.tsx @@ -66,11 +66,22 @@ const SavedGift = ({ const canManage = peerId === currentUserId || hasAdminRights; const totalIssued = getTotalGiftAvailability(gift.gift); - const ribbonText = gift.isPinned && gift.gift.type === 'starGiftUnique' - ? lang('GiftSavedNumber', { number: gift.gift.number }) - : totalIssued - ? lang('ActionStarGiftLimitedRibbon', { total: formatIntegerCompact(lang, totalIssued) }) - : undefined; + const starGift = gift.gift; + const starGiftUnique = starGift.type === 'starGiftUnique' ? starGift : undefined; + const ribbonText = (() => { + if (starGiftUnique?.resellPriceInStars) { + return lang('GiftRibbonSale'); + } + if (gift.isPinned && starGiftUnique) { + return lang('GiftSavedNumber', { number: starGiftUnique.number }); + } + if (totalIssued) { + return lang('ActionStarGiftLimitedRibbon', { total: formatIntegerCompact(lang, totalIssued) }); + } + return undefined; + })(); + + const ribbonColor = starGiftUnique?.resellPriceInStars ? 'green' : 'blue'; const { isContextMenuOpen, contextMenuAnchor, @@ -150,7 +161,7 @@ const SavedGift = ({ )} {ribbonText && ( )} diff --git a/src/components/middle/message/ActionMessageText.tsx b/src/components/middle/message/ActionMessageText.tsx index 5b36ed149..fb77b6334 100644 --- a/src/components/middle/message/ActionMessageText.tsx +++ b/src/components/middle/message/ActionMessageText.tsx @@ -597,7 +597,7 @@ const ActionMessageText = ({ case 'starGiftUnique': { const { - isTransferred, isUpgrade, savedId, peerId, fromId, + isTransferred, isUpgrade, savedId, peerId, fromId, resaleStars, gift, } = action; const isToChannel = Boolean(peerId && savedId); @@ -606,6 +606,19 @@ const ActionMessageText = ({ const fromTitle = (fromPeer && getPeerTitle(lang, fromPeer)) || userFallbackText; const fromLink = renderPeerLink(fromPeer?.id, fromTitle, asPreview); + if (resaleStars) { + return lang( + isOutgoing + ? 'ApiMessageMessageActionResaleStarGiftUniqueOutgoing' + : 'ApiMessageMessageActionResaleStarGiftUniqueIncoming', + { + gift: lang('GiftUnique', { title: gift.title, number: gift.number }), + stars: renderStrong(formatStarsAsText(lang, resaleStars)), + }, + { withNodes: true }, + ); + } + if (isToChannel) { const channelPeer = selectPeer(global, peerId!); const isYou = fromPeer?.id === currentUserId; diff --git a/src/components/modals/ModalContainer.tsx b/src/components/modals/ModalContainer.tsx index ace221a46..1fe6bb587 100644 --- a/src/components/modals/ModalContainer.tsx +++ b/src/components/modals/ModalContainer.tsx @@ -19,6 +19,7 @@ import FrozenAccountModal from './frozenAccount/FrozenAccountModal.async'; import PremiumGiftModal from './gift/GiftModal.async'; import GiftInfoModal from './gift/info/GiftInfoModal.async'; import GiftRecipientPicker from './gift/recipient/GiftRecipientPicker.async'; +import GiftResalePriceComposerModal from './gift/resale/GiftResalePriceComposerModal.async'; import GiftStatusInfoModal from './gift/status/GiftStatusInfoModal.async'; import GiftTransferModal from './gift/transfer/GiftTransferModal.async'; import GiftUpgradeModal from './gift/upgrade/GiftUpgradeModal.async'; @@ -69,6 +70,7 @@ type ModalKey = keyof Pick { const { openChat } = getActions(); const handleOpenChat = useLastCallback((peerId: string) => { @@ -66,6 +70,8 @@ const TableInfoModal = ({ className={className} contentClassName={styles.content} onClose={onClose} + withBalanceBar={withBalanceBar} + isLowStackPriority={isLowStackPriority} > {headerAvatarPeer && ( diff --git a/src/components/modals/gift/UniqueGiftHeader.module.scss b/src/components/modals/gift/UniqueGiftHeader.module.scss index f35b6b6a1..2270a24c4 100644 --- a/src/components/modals/gift/UniqueGiftHeader.module.scss +++ b/src/components/modals/gift/UniqueGiftHeader.module.scss @@ -19,6 +19,17 @@ z-index: -1; } +.amount { + display: flex; + gap: 0.25rem; + font-size: 1.125rem; + font-weight: var(--font-weight-medium); + line-height: 1.325; + margin-bottom: 0.125rem; + align-items: center; + color: white; +} + .sticker { margin-top: 2rem; } diff --git a/src/components/modals/gift/UniqueGiftHeader.tsx b/src/components/modals/gift/UniqueGiftHeader.tsx index a68aff137..71d365355 100644 --- a/src/components/modals/gift/UniqueGiftHeader.tsx +++ b/src/components/modals/gift/UniqueGiftHeader.tsx @@ -2,14 +2,20 @@ import React, { memo, useMemo } from '../../../lib/teact/teact'; import type { ApiStarGiftAttributeBackdrop, ApiStarGiftAttributeModel, ApiStarGiftAttributePattern, + ApiStarsAmount, } from '../../../api/types'; +import { + formatStarsTransactionAmount, +} from '../../../global/helpers/payments'; import buildClassName from '../../../util/buildClassName'; import buildStyle from '../../../util/buildStyle'; import { useTransitionActiveKey } from '../../../hooks/animations/useTransitionActiveKey'; +import useLang from '../../../hooks/useLang'; import AnimatedIconFromSticker from '../../common/AnimatedIconFromSticker'; +import StarIcon from '../../common/icons/StarIcon'; import RadialPatternBackground from '../../common/profile/RadialPatternBackground'; import Transition from '../../ui/Transition'; @@ -22,6 +28,7 @@ type OwnProps = { title?: string; subtitle?: string; className?: string; + resellPrice?: ApiStarsAmount; }; const STICKER_SIZE = 120; @@ -33,7 +40,9 @@ const UniqueGiftHeader = ({ title, subtitle, className, + resellPrice, }: OwnProps) => { + const lang = useLang(); const activeKey = useTransitionActiveKey([modelAttribute, backdropAttribute, patternAttribute]); const subtitleColor = backdropAttribute?.textColor; @@ -73,6 +82,14 @@ const UniqueGiftHeader = ({ {subtitle}

)} + {resellPrice && ( +

+ + {formatStarsTransactionAmount(lang, resellPrice)} + + +

+ )} ); }; diff --git a/src/components/modals/gift/info/GiftInfoModal.module.scss b/src/components/modals/gift/info/GiftInfoModal.module.scss index dc3dc4475..b6726ab76 100644 --- a/src/components/modals/gift/info/GiftInfoModal.module.scss +++ b/src/components/modals/gift/info/GiftInfoModal.module.scss @@ -18,6 +18,63 @@ color: var(--color-error); } +.headerSplitButton { + display: flex; + flex-direction: row; + position: absolute; + right: 0.375rem; +} + +.headerButton, +.giftResalePriceContainer { + height: 1.75rem; + width: fit-content; + font-size: 1rem; + font-weight: var(--font-weight-medium); + + outline: none !important; + align-items: center; + display: flex; + justify-content: center; + color: white; + border-radius: 1rem; + background-color: rgba(0, 0, 0, 0.2); + backdrop-filter: blur(25px); + pointer-events: auto; + padding: 0.25rem; + padding-inline: 0.625rem; +} + +.giftResalePriceContainer { + font-size: 0.75rem; +} + +.giftResalePriceStar { + margin-inline-start: 0 !important; +} + +.headerButton { + position: relative; + cursor: var(--custom-cursor, pointer); + flex-shrink: 0; + overflow: hidden; + transition: background-color 0.15s; + + &:hover { + background-color: rgba(0, 0, 0, 0.1); + } +} + +.left { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} + +.right { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} + .description { text-align: center; color: var(--_color-description, var(--color-text)); diff --git a/src/components/modals/gift/info/GiftInfoModal.tsx b/src/components/modals/gift/info/GiftInfoModal.tsx index 783cc8d87..7156ffa9a 100644 --- a/src/components/modals/gift/info/GiftInfoModal.tsx +++ b/src/components/modals/gift/info/GiftInfoModal.tsx @@ -1,10 +1,11 @@ import type { FC, TeactNode } from '../../../../lib/teact/teact'; -import React, { memo, useMemo } from '../../../../lib/teact/teact'; +import React, { memo, useMemo, useState } from '../../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../../global'; import type { ApiEmojiStatusType, ApiPeer, + ApiUser, } from '../../../../api/types'; import type { TabState } from '../../../../global/types'; @@ -31,6 +32,7 @@ import AnimatedIconFromSticker from '../../../common/AnimatedIconFromSticker'; import Avatar from '../../../common/Avatar'; import BadgeButton from '../../../common/BadgeButton'; import GiftMenuItems from '../../../common/gift/GiftMenuItems'; +import GiftTransferPreview from '../../../common/gift/GiftTransferPreview'; import Icon from '../../../common/icons/Icon'; import SafeLink from '../../../common/SafeLink'; import Button from '../../../ui/Button'; @@ -55,6 +57,7 @@ type StateProps = { currentUserEmojiStatus?: ApiEmojiStatusType; collectibleEmojiStatuses?: ApiEmojiStatusType[]; tonExplorerUrl?: string; + currentUser?: ApiUser; }; const STICKER_SIZE = 120; @@ -69,6 +72,7 @@ const GiftInfoModal = ({ currentUserEmojiStatus, collectibleEmojiStatuses, tonExplorerUrl, + currentUser, }: OwnProps & StateProps) => { const { closeGiftInfoModal, @@ -78,12 +82,14 @@ const GiftInfoModal = ({ focusMessage, openGiftUpgradeModal, showNotification, + buyStarGift, } = getActions(); const [isConvertConfirmOpen, openConvertConfirm, closeConvertConfirm] = useFlag(); const lang = useLang(); const oldLang = useOldLang(); + const [isConfirmModalOpen, setIsConfirmModalOpen] = useState(false); const isOpen = Boolean(modal); const renderingModal = useCurrentOrPrev(modal); @@ -106,12 +112,24 @@ const GiftInfoModal = ({ const hasConvertOption = canConvertDifference > 0 && Boolean(savedGift?.starsToConvert); const isGiftUnique = gift && gift.type === 'starGiftUnique'; + const uniqueGift = isGiftUnique ? gift : undefined; const canFocusUpgrade = Boolean(savedGift?.upgradeMsgId); const canManage = !canFocusUpgrade && savedGift?.inputGift && ( isTargetChat ? hasAdminRights : renderingTargetPeer?.id === currentUserId ); + const resellPriceInStars = isGiftUnique ? gift.resellPriceInStars : undefined; + const canBuyGift = !canManage && Boolean(resellPriceInStars); + + const giftOwnerTitle = (() => { + if (!isGiftUnique) return undefined; + const { ownerName, ownerId } = gift; + const global = getGlobal(); // Peer titles do not need to be reactive + const owner = ownerId ? selectPeer(global, ownerId) : undefined; + return owner ? getPeerTitle(lang, owner) : ownerName; + })(); + const handleClose = useLastCallback(() => { closeGiftInfoModal(); }); @@ -142,26 +160,57 @@ const GiftInfoModal = ({ openGiftUpgradeModal({ giftId: savedGift.gift.id, gift: savedGift }); }); + const handleBuyGift = useLastCallback(() => { + if (!savedGift || gift?.type !== 'starGiftUnique' || !gift.resellPriceInStars) return; + setIsConfirmModalOpen(true); + }); + + const closeConfirmModal = useLastCallback(() => { + setIsConfirmModalOpen(false); + }); + + const handleConfirmBuyGift = useLastCallback(() => { + if (!savedGift || gift?.type !== 'starGiftUnique' || !gift.resellPriceInStars) return; + closeConfirmModal(); + buyStarGift({ slug: gift.slug, stars: gift.resellPriceInStars }); + }); + const giftAttributes = useMemo(() => { return gift && getGiftAttributes(gift); }, [gift]); const SettingsMenuButton: FC<{ onTrigger: () => void; isMenuOpen?: boolean }> = useMemo(() => { - return ({ onTrigger, isMenuOpen }) => ( - + + ); }, [lang]); const renderFooterButton = useLastCallback(() => { + if (canBuyGift) { + return ( + + ); + } + if (canFocusUpgrade) { return ( - {isOpen && uniqueGiftContextMenu} + {Boolean(canManage && resellPriceInStars) && ( +
+ {formatStarsAsIcon(lang, resellPriceInStars!, { + asFont: true, + className: styles.giftResalePriceStar, + })} +
+ )} +
+ {isOpen && uniqueGiftContextMenu} +
+ +
+
); @@ -574,7 +642,7 @@ const GiftInfoModal = ({ const footer = (
- {(canManage || tonLink) && ( + {(canManage || tonLink || canBuyGift) && (
{tonLink && (
@@ -596,11 +664,18 @@ const GiftInfoModal = ({ })}
)} - {isVisibleForMe && ( + {!canBuyGift && isVisibleForMe && (
{lang('GiftInfoSenderHidden')}
)} + {canBuyGift && giftOwnerTitle && ( +
+ {lang('GiftInfoBuyGift', { + user: giftOwnerTitle, + }, { withNodes: true })} +
+ )}
)} {renderFooterButton()} @@ -617,8 +692,9 @@ const GiftInfoModal = ({ typeGift, savedGift, renderingTargetPeer, giftSticker, lang, canManage, hasConvertOption, isSender, oldLang, tonExplorerUrl, gift, giftAttributes, renderFooterButton, isTargetChat, - SettingsMenuButton, isOpen, isGiftUnique, renderingModal, + SettingsMenuButton, isGiftUnique, renderingModal, collectibleEmojiStatuses, currentUserEmojiStatus, saleDateInfo, + canBuyGift, giftOwnerTitle, isOpen, resellPriceInStars, ]); return ( @@ -632,7 +708,35 @@ const GiftInfoModal = ({ footer={modalData?.footer} className={styles.modal} onClose={handleClose} + withBalanceBar={Boolean(canBuyGift)} + isLowStackPriority /> + {uniqueGift && currentUser && resellPriceInStars && ( + + + +

+ {lang('GiftBuyConfirmDescription', { + gift: lang('GiftUnique', { title: uniqueGift.title, number: uniqueGift.number }), + stars: formatStarsAsText(lang, resellPriceInStars), + }, { + withNodes: true, + withMarkdown: true, + })} +

+
+ )} {savedGift && ( ( hasAdminRights, currentUserEmojiStatus, collectibleEmojiStatuses, + currentUser, }; }, )(GiftInfoModal)); diff --git a/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx b/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx new file mode 100644 index 000000000..062736272 --- /dev/null +++ b/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx @@ -0,0 +1,18 @@ +import type { FC } from '../../../../lib/teact/teact'; +import React from '../../../../lib/teact/teact'; + +import type { OwnProps } from './GiftResalePriceComposerModal'; + +import { Bundles } from '../../../../util/moduleLoader'; + +import useModuleLoader from '../../../../hooks/useModuleLoader'; + +const GiftResalePriceComposerModalAsync: FC = (props) => { + const { modal } = props; + const GiftResalePriceComposerModal = useModuleLoader(Bundles.Stars, 'GiftResalePriceComposerModal', !modal); + + // eslint-disable-next-line react/jsx-props-no-spreading + return GiftResalePriceComposerModal ? : undefined; +}; + +export default GiftResalePriceComposerModalAsync; diff --git a/src/components/modals/gift/resale/GiftResalePriceComposerModal.module.scss b/src/components/modals/gift/resale/GiftResalePriceComposerModal.module.scss new file mode 100644 index 000000000..4e02123da --- /dev/null +++ b/src/components/modals/gift/resale/GiftResalePriceComposerModal.module.scss @@ -0,0 +1,19 @@ +.descriptionContainer { + color: var(--color-text-secondary); + font-size: 0.875rem; + margin-bottom: 2rem; + margin-inline: 1rem; + display: flex; +} + +.descriptionPrice { + margin-left: auto; +} + +.inputPrice { + margin-top: 0.5rem; + + :global(.input-group) { + margin-bottom: 0.25rem; + } +} diff --git a/src/components/modals/gift/resale/GiftResalePriceComposerModal.tsx b/src/components/modals/gift/resale/GiftResalePriceComposerModal.tsx new file mode 100644 index 000000000..f47923ac0 --- /dev/null +++ b/src/components/modals/gift/resale/GiftResalePriceComposerModal.tsx @@ -0,0 +1,158 @@ +import React, { + memo, useState, +} from '../../../../lib/teact/teact'; +import { getActions, withGlobal } from '../../../../global'; + +import type { TabState } from '../../../../global/types'; + +import { formatCurrencyAsString } from '../../../../util/formatCurrency'; +import { formatStarsAsIcon, formatStarsAsText } from '../../../../util/localization/format'; + +import useCurrentOrPrev from '../../../../hooks/useCurrentOrPrev'; +import useLang from '../../../../hooks/useLang'; +import useLastCallback from '../../../../hooks/useLastCallback'; + +import Button from '../../../ui/Button'; +import InputText from '../../../ui/InputText'; +import Modal from '../../../ui/Modal'; + +import styles from './GiftResalePriceComposerModal.module.scss'; + +export type OwnProps = { + modal: TabState['giftResalePriceComposerModal']; +}; + +export type StateProps = { + starsStargiftResaleCommissionPermille?: number; + starsStargiftResaleAmountMin: number; + starsStargiftResaleAmountMax?: number; + starsUsdWithdrawRate?: number; +}; + +const GiftResalePriceComposerModal = ({ + modal, starsStargiftResaleCommissionPermille, + starsStargiftResaleAmountMin, starsStargiftResaleAmountMax, starsUsdWithdrawRate, +}: OwnProps & StateProps) => { + const { + closeGiftResalePriceComposerModal, + closeGiftInfoModal, + updateStarGiftPrice, + showNotification, + } = getActions(); + const isOpen = Boolean(modal); + const [price, setPrice] = useState(undefined); + + const renderingModal = useCurrentOrPrev(modal); + const { gift: typeGift } = renderingModal || {}; + const isSavedGift = typeGift && 'gift' in typeGift; + const savedGift = isSavedGift ? typeGift : undefined; + const hasPrice = Boolean(price); + + const lang = useLang(); + + const handleChangePrice = useLastCallback((e) => { + const value = e.target.value; + const number = parseFloat(value); + const result = value === '' || Number.isNaN(number) ? undefined + : starsStargiftResaleAmountMax ? Math.min(number, starsStargiftResaleAmountMax) : number; + setPrice(result); + }); + + const handleClose = useLastCallback(() => { + closeGiftResalePriceComposerModal(); + }); + + const handleSellGift = useLastCallback(() => { + if (!savedGift || savedGift.gift.type !== 'starGiftUnique' || !savedGift.inputGift || !price) return; + closeGiftResalePriceComposerModal(); + closeGiftInfoModal(); + updateStarGiftPrice({ gift: savedGift.inputGift, price }); + showNotification({ + icon: 'sell-outline', + message: { + key: 'NotificationGiftIsSale', + variables: { + gift: lang('GiftUnique', { title: savedGift.gift.title, number: savedGift.gift.number }), + }, + }, + }); + }); + const commission = starsStargiftResaleCommissionPermille; + const isPriceCorrect = hasPrice && price > starsStargiftResaleAmountMin; + + return ( + +
+ +
+ +
+ + {!isPriceCorrect && commission && lang('DescriptionComposerGiftMinimumPrice', { + stars: formatStarsAsText(lang, starsStargiftResaleAmountMin), + }, { + withMarkdown: true, + withNodes: true, + })} + {isPriceCorrect && lang('DescriptionComposerGiftResalePrice', + { + stars: formatStarsAsText(lang, commission ? Number((price * (commission)).toFixed()) : price), + }, + { + withMarkdown: true, + withNodes: true, + })} + + + {isPriceCorrect && starsUsdWithdrawRate && ( + + {`≈ ${formatCurrencyAsString( + price * starsUsdWithdrawRate, + 'USD', + lang.code, + )}`} + + )} +
+ + +
+ ); +}; + +export default memo(withGlobal( + (global): StateProps => { + const configPermille = global.appConfig?.starsStargiftResaleCommissionPermille; + const starsStargiftResaleCommissionPermille = configPermille ? (configPermille / 1000) : undefined; + const starsStargiftResaleAmountMin = global.appConfig?.starsStargiftResaleAmountMin || 0; + const starsStargiftResaleAmountMax = global.appConfig?.starsStargiftResaleAmountMax; + + const starsUsdWithdrawRateX1000 = global.appConfig?.starsUsdWithdrawRateX1000; + const starsUsdWithdrawRate = starsUsdWithdrawRateX1000 ? starsUsdWithdrawRateX1000 / 1000 : 1; + + return { + starsStargiftResaleCommissionPermille, + starsStargiftResaleAmountMin, + starsStargiftResaleAmountMax, + starsUsdWithdrawRate, + }; + }, +)(GiftResalePriceComposerModal)); diff --git a/src/components/modals/gift/transfer/GiftTransferModal.tsx b/src/components/modals/gift/transfer/GiftTransferModal.tsx index e3ecf5fd3..96bd68071 100644 --- a/src/components/modals/gift/transfer/GiftTransferModal.tsx +++ b/src/components/modals/gift/transfer/GiftTransferModal.tsx @@ -14,7 +14,6 @@ import { unique } from '../../../../util/iteratees'; import { formatStarsAsIcon, formatStarsAsText } from '../../../../util/localization/format'; import { MEMO_EMPTY_ARRAY } from '../../../../util/memo'; import { getGiftAttributes } from '../../../common/helpers/gifts'; -import { REM } from '../../../common/helpers/mediaDimensions'; import sortChatIds from '../../../common/helpers/sortChatIds'; import useCurrentOrPrev from '../../../../hooks/useCurrentOrPrev'; @@ -23,16 +22,11 @@ import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; import usePeerSearch from '../../../../hooks/usePeerSearch'; -import AnimatedIconFromSticker from '../../../common/AnimatedIconFromSticker'; -import Avatar from '../../../common/Avatar'; -import Icon from '../../../common/icons/Icon'; +import GiftTransferPreview from '../../../common/gift/GiftTransferPreview'; import PeerPicker from '../../../common/pickers/PeerPicker'; import PickerModal from '../../../common/pickers/PickerModal'; -import RadialPatternBackground from '../../../common/profile/RadialPatternBackground'; import ConfirmDialog from '../../../ui/ConfirmDialog'; -import styles from './GiftTransferModal.module.scss'; - export type OwnProps = { modal: TabState['giftTransferModal']; }; @@ -44,9 +38,6 @@ type StateProps = { type Categories = 'withdraw'; -const AVATAR_SIZE = 4 * REM; -const GIFT_STICKER_SIZE = 3 * REM; - const GiftTransferModal = ({ modal, contactIds, currentUserId, }: OwnProps & StateProps) => { @@ -175,27 +166,12 @@ const GiftTransferModal = ({ ) : lang('GiftTransferConfirmButtonFree')} confirmHandler={handleTransfer} > -
-
- - -
- - -
+ )}

{renderingModal?.gift.transferStars ? lang('GiftTransferConfirmDescription', { diff --git a/src/components/modals/stars/helpers/transaction.ts b/src/components/modals/stars/helpers/transaction.ts index a2b67879e..c3feca92a 100644 --- a/src/components/modals/stars/helpers/transaction.ts +++ b/src/components/modals/stars/helpers/transaction.ts @@ -18,6 +18,13 @@ export function getTransactionTitle(oldLang: OldLangFn, lang: LangFn, transactio }, ); } + + if (transaction.isGiftResale) { + return isNegativeStarsAmount(transaction.stars) + ? lang('StarGiftSaleTransaction') + : lang('StarGiftPurchaseTransaction'); + } + if (transaction.starRefCommision) { return oldLang('StarTransactionCommission', formatPercent(transaction.starRefCommision)); } diff --git a/src/components/modals/stars/transaction/StarsTransactionItem.tsx b/src/components/modals/stars/transaction/StarsTransactionItem.tsx index 15ce88602..57674f9de 100644 --- a/src/components/modals/stars/transaction/StarsTransactionItem.tsx +++ b/src/components/modals/stars/transaction/StarsTransactionItem.tsx @@ -80,7 +80,11 @@ const StarsTransactionItem = ({ transaction, className }: OwnProps) => { } if (transaction.isGiftUpgrade && transaction.starGift?.type === 'starGiftUnique') { - description = transaction.starGift.title; + description = lang('GiftUnique', { title: transaction.starGift.title, number: transaction.starGift.number }); + } + + if (transaction.isGiftResale && transaction.starGift?.type === 'starGiftUnique') { + description = lang('GiftUnique', { title: transaction.starGift.title, number: transaction.starGift.number }); } if (transaction.photo) { diff --git a/src/components/modals/stars/transaction/StarsTransactionModal.tsx b/src/components/modals/stars/transaction/StarsTransactionModal.tsx index f946a72b7..67ccaaffa 100644 --- a/src/components/modals/stars/transaction/StarsTransactionModal.tsx +++ b/src/components/modals/stars/transaction/StarsTransactionModal.tsx @@ -85,7 +85,7 @@ const StarsTransactionModal: FC = ({ } const { - giveawayPostId, photo, stars, isGiftUpgrade, starGift, + giveawayPostId, photo, stars, isGiftUpgrade, starGift, isGiftResale, } = transaction; const gift = transaction?.starGift; @@ -131,6 +131,7 @@ const StarsTransactionModal: FC = ({ modelAttribute={giftAttributes!.model!} title={gift.title} subtitle={lang('GiftInfoCollectible', { number: gift.number })} + resellPrice={transaction.stars} />

); @@ -194,7 +195,7 @@ const StarsTransactionModal: FC = ({ const tableData: TableData = []; - if (transaction && !transaction.paidMessages) { + if (transaction && !transaction.paidMessages && !isGiftResale) { tableData.push([ oldLang('StarsTransaction.StarRefReason.Title'), oldLang('StarsTransaction.StarRefReason.Program'), @@ -208,12 +209,21 @@ const StarsTransactionModal: FC = ({ ]); } + if (isGiftResale) { + tableData.push([ + oldLang('StarGiftReason'), + isNegativeStarsAmount(transaction.stars) + ? lang('StarGiftSaleTransaction') + : lang('StarGiftPurchaseTransaction'), + ]); + } + let peerLabel; if (isGiftUpgrade) { peerLabel = oldLang('Stars.Transaction.GiftFrom'); } else if (isNegativeStarsAmount(stars) || transaction.isMyGift) { peerLabel = oldLang('Stars.Transaction.To'); - } else if (transaction.starRefCommision && !transaction.paidMessages) { + } else if (transaction.starRefCommision && !transaction.paidMessages && !isGiftResale) { peerLabel = oldLang('StarsTransaction.StarRefReason.Miniapp'); } else if (peerId) { peerLabel = oldLang('Star.Transaction.From'); diff --git a/src/components/ui/Modal.scss b/src/components/ui/Modal.scss index 67871528c..9c368253b 100644 --- a/src/components/ui/Modal.scss +++ b/src/components/ui/Modal.scss @@ -54,6 +54,16 @@ align-items: center; } + &.with-balance-bar { + .modal-container { + top: 5.5rem; + } + .modal-dialog { + margin-top: 0; + max-height: calc(100vh - 7.5rem); + } + } + .modal-backdrop { position: fixed; top: 0; diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index 763e5eba2..8886b47ee 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -17,6 +17,7 @@ import useShowTransition from '../../hooks/useShowTransition'; import Icon from '../common/icons/Icon'; import Button, { type OwnProps as ButtonProps } from './Button'; +import ModalStarBalanceBar from './ModalStarBalanceBar'; import Portal from './Portal'; import './Modal.scss'; @@ -46,6 +47,7 @@ export type OwnProps = { onClose: () => void; onCloseAnimationEnd?: () => void; onEnter?: () => void; + withBalanceBar?: Boolean; }; const Modal: FC = ({ @@ -70,6 +72,7 @@ const Modal: FC = ({ onClose, onCloseAnimationEnd, onEnter, + withBalanceBar, }) => { const { ref: modalRef, @@ -167,6 +170,7 @@ const Modal: FC = ({ noBackdrop && 'transparent-backdrop', isSlim && 'slim', isLowStackPriority && 'low-priority', + withBalanceBar && 'with-balance-bar', ); return ( @@ -177,6 +181,11 @@ const Modal: FC = ({ tabIndex={-1} role="dialog" > + {withBalanceBar && ( + + )}
diff --git a/src/components/ui/ModalStarBalanceBar.module.scss b/src/components/ui/ModalStarBalanceBar.module.scss new file mode 100644 index 000000000..7750b4ecb --- /dev/null +++ b/src/components/ui/ModalStarBalanceBar.module.scss @@ -0,0 +1,46 @@ +.root { + position: absolute; + top: 0rem; + left: 50%; + background-color: var(--color-background); + color: var(--color-text); + + display: flex; + flex-direction: column; + align-items: center; + + padding: 0.5rem 1.25rem; + border-radius: 2rem; + font-size: 0.875rem; + white-space: nowrap; + z-index: var(--z-modal); + + :global(.confirm) & { + z-index: var(--z-modal-confirm); + } + + :global(.low-priority) & { + z-index: var(--z-modal-low-priority); + } + + transform: translate(-50%, -1rem); + + transition: transform 0.2s ease, opacity 0.2s ease; + + :global(body:not(.no-page-transitions)) .dots { + transition: none; + transform: none !important; + } + + &:not(:global(.open)) { + transform: translate(-50%, 0); + } + + &:not(:global(.closing)) { + transform: translate(-50%, 1rem); + } +} + +.starIcon { + margin-inline-start: 0.125rem !important; +} diff --git a/src/components/ui/ModalStarBalanceBar.tsx b/src/components/ui/ModalStarBalanceBar.tsx new file mode 100644 index 000000000..dbc273eed --- /dev/null +++ b/src/components/ui/ModalStarBalanceBar.tsx @@ -0,0 +1,88 @@ +import React, { + memo, +} from '../../lib/teact/teact'; +import { getActions, withGlobal } from '../../global'; + +import type { ApiStarsAmount } from '../../api/types'; + +import { formatStarsAmount } from '../../global/helpers/payments'; +import buildClassName from '../../util/buildClassName'; +import { formatStarsAsIcon } from '../../util/localization/format'; + +import useLang from '../../hooks/useLang'; +import useLastCallback from '../../hooks/useLastCallback'; +import useShowTransition from '../../hooks/useShowTransition'; + +import Link from './Link'; + +import styles from './ModalStarBalanceBar.module.scss'; + +export type OwnProps = { + onCloseAnimationEnd?: () => void; + isModalOpen?: true; +}; + +export type StateProps = { + starBalance?: ApiStarsAmount; +}; + +function ModalStarBalanceBar({ + starBalance, + isModalOpen, + onCloseAnimationEnd, +}: StateProps & OwnProps) { + const { + openStarsBalanceModal, + } = getActions(); + + const lang = useLang(); + const isOpen = isModalOpen ? Boolean(starBalance) : false; + + const { + ref, + shouldRender, + } = useShowTransition({ + isOpen, + onCloseAnimationEnd, + withShouldRender: true, + }); + + const handleGetMoreStars = useLastCallback(() => { + openStarsBalanceModal({}); + }); + + if (!shouldRender || !starBalance) { + return undefined; + } + + return ( +
+
+ {lang('ModalStarsBalanceBarDescription', { + stars: formatStarsAsIcon(lang, formatStarsAmount(lang, starBalance), { className: styles.starIcon }), + }, { + withNodes: true, + withMarkdown: true, + })} +
+
+ {lang('GetMoreStarsLinkText')} +
+
+ ); +} + +export default memo(withGlobal( + (global): StateProps => { + const { + stars, + } = global; + + return { + starBalance: stars?.balance, + }; + }, +)(ModalStarBalanceBar)); diff --git a/src/global/actions/api/payments.ts b/src/global/actions/api/payments.ts index 249b65ec8..1932180f5 100644 --- a/src/global/actions/api/payments.ts +++ b/src/global/actions/api/payments.ts @@ -1,5 +1,6 @@ import type { - ApiInputInvoice, ApiInputInvoicePremiumGiftStars, ApiInputInvoiceStarGift, ApiRequestInputInvoice, + ApiInputInvoice, ApiInputInvoicePremiumGiftStars, ApiInputInvoiceStarGift, ApiInputInvoiceStarGiftResale, + ApiRequestInputInvoice, } from '../../../api/types'; import type { ApiCredentials } from '../../../components/payment/PaymentModal'; import type { RegularLangFnParameters } from '../../../util/localization'; @@ -143,6 +144,20 @@ addActionHandler('sendStarGift', (global, actions, payload): ActionReturnType => payInputStarInvoice(global, inputInvoice, gift.stars, tabId); }); +addActionHandler('buyStarGift', (global, actions, payload): ActionReturnType => { + const { + slug, stars, tabId = getCurrentTabId(), + } = payload; + + const inputInvoice: ApiInputInvoiceStarGiftResale = { + type: 'stargiftResale', + slug, + peerId: global.currentUserId!, + }; + + payInputStarInvoice(global, inputInvoice, stars, tabId); +}); + addActionHandler('sendPremiumGiftByStars', (global, actions, payload): ActionReturnType => { const { userId, months, amount, message, tabId = getCurrentTabId(), @@ -1184,6 +1199,7 @@ addActionHandler('processStarGiftWithdrawal', async (global, actions, payload): function handlePaymentFormError(error: string, tabId: number) { if (error === 'SLUG_INVALID') { + // eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions getActions().showNotification({ message: { key: 'PaymentInvoiceNotFound', @@ -1193,5 +1209,6 @@ function handlePaymentFormError(error: string, tabId: number) { return; } + // eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions getActions().showDialog({ data: { message: error, hasErrorKey: true }, tabId }); } diff --git a/src/global/actions/api/stars.ts b/src/global/actions/api/stars.ts index e038dac2c..9e0adf280 100644 --- a/src/global/actions/api/stars.ts +++ b/src/global/actions/api/stars.ts @@ -1,5 +1,6 @@ import type { ApiSavedStarGift, ApiStarGiftUnique } from '../../../api/types'; import type { StarGiftCategory } from '../../../types'; +import type { ActionReturnType } from '../../types'; import { getCurrentTabId } from '../../../util/establishMultitabRole'; import { buildCollectionByKey } from '../../../util/iteratees'; @@ -144,12 +145,13 @@ addActionHandler('loadPeerSavedGifts', async (global, actions, payload): Promise const peer = selectPeer(global, peerId); if (!peer) return; + global = getGlobal(); + const currentGifts = selectPeerSavedGifts(global, peerId, tabId); const localNextOffset = currentGifts?.nextOffset; if (!shouldRefresh && currentGifts && !localNextOffset) return; // Already loaded all - global = getGlobal(); const fetchingFilter = selectGiftProfileFilter(global, peerId, tabId); const result = await callApi('fetchSavedStarGifts', { @@ -171,6 +173,18 @@ addActionHandler('loadPeerSavedGifts', async (global, actions, payload): Promise setGlobal(global); }); +addActionHandler('reloadPeerSavedGifts', (global, actions, payload): ActionReturnType => { + const { + peerId, + } = payload; + + Object.values(global.byTabId).forEach((tabState) => { + if (selectPeerSavedGifts(global, peerId, tabState.id)) { + actions.loadPeerSavedGifts({ peerId, shouldRefresh: true, tabId: tabState.id }); + } + }); +}); + addActionHandler('loadStarsSubscriptions', async (global): Promise => { const subscriptions = global.stars?.subscriptions; const offset = subscriptions?.nextOffset; @@ -347,3 +361,24 @@ addActionHandler('toggleSavedGiftPinned', async (global, actions, payload): Prom } }); }); + +addActionHandler('updateStarGiftPrice', async (global, actions, payload): Promise => { + const { + gift, price, + } = payload; + + const requestSavedGift = getRequestInputSavedStarGift(global, gift); + + if (!requestSavedGift) { + return; + } + + const result = await callApi('updateStarGiftPrice', { + inputSavedGift: requestSavedGift, + price, + }); + + if (!result) return; + + actions.reloadPeerSavedGifts({ peerId: global.currentUserId! }); +}); diff --git a/src/global/actions/apiUpdaters/payments.ts b/src/global/actions/apiUpdaters/payments.ts index 5cd9b5ef0..de0f2d79c 100644 --- a/src/global/actions/apiUpdaters/payments.ts +++ b/src/global/actions/apiUpdaters/payments.ts @@ -151,6 +151,25 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => { } } + if (inputInvoice?.type === 'stargiftResale') { + const starGiftModalState = selectTabState(global, tabId).giftInfoModal; + + if (starGiftModalState) { + actions.showNotification({ + message: { + key: 'StarsGiftBought', + }, + tabId, + }); + if (starGiftModalState.peerId) { + actions.reloadPeerSavedGifts({ peerId: starGiftModalState.peerId }); + } + actions.reloadPeerSavedGifts({ peerId: inputInvoice.peerId }); + actions.requestConfetti({ withStars: true, tabId }); + actions.closeGiftInfoModal({ tabId }); + } + } + break; } diff --git a/src/global/actions/ui/stars.ts b/src/global/actions/ui/stars.ts index ba391d40e..b202f8a34 100644 --- a/src/global/actions/ui/stars.ts +++ b/src/global/actions/ui/stars.ts @@ -265,8 +265,23 @@ addActionHandler('openGiftInfoModal', (global, actions, payload): ActionReturnTy }, tabId); }); +addActionHandler('openGiftResalePriceComposerModal', (global, actions, payload): ActionReturnType => { + const { + gift, peerId, tabId = getCurrentTabId(), + } = payload; + + return updateTabState(global, { + giftResalePriceComposerModal: { + peerId, + gift, + }, + }, tabId); +}); + addTabStateResetterAction('closeGiftInfoModal', 'giftInfoModal'); +addTabStateResetterAction('closeGiftResalePriceComposerModal', 'giftResalePriceComposerModal'); + addTabStateResetterAction('closeGiftUpgradeModal', 'giftUpgradeModal'); addActionHandler('openGiftWithdrawModal', (global, actions, payload): ActionReturnType => { diff --git a/src/global/helpers/payments.ts b/src/global/helpers/payments.ts index 7a54c61d5..fdcdc6990 100644 --- a/src/global/helpers/payments.ts +++ b/src/global/helpers/payments.ts @@ -21,6 +21,22 @@ export function getRequestInputInvoice( ): ApiRequestInputInvoice | undefined { if (inputInvoice.type === 'slug') return inputInvoice; + if (inputInvoice.type === 'stargiftResale') { + const { + slug, + peerId, + } = inputInvoice; + const peer = selectPeer(global, peerId); + + if (!peer) return undefined; + + return { + type: 'stargiftResale', + slug, + peer, + }; + } + if (inputInvoice.type === 'stargift') { const { peerId, shouldHideName, giftId, message, shouldUpgrade, diff --git a/src/global/types/actions.ts b/src/global/types/actions.ts index 2c02196dd..b7e060f27 100644 --- a/src/global/types/actions.ts +++ b/src/global/types/actions.ts @@ -2406,6 +2406,10 @@ export interface ActionPayloads { } & WithTabId; closeGiftModal: WithTabId | undefined; sendStarGift: StarGiftInfo & WithTabId; + buyStarGift: { + slug: string; + stars: number; + } & WithTabId; sendPremiumGiftByStars: { userId: string; months: number; @@ -2423,7 +2427,12 @@ export interface ActionPayloads { } | { gift: ApiStarGift; }) & WithTabId; + openGiftResalePriceComposerModal: ({ + peerId: string; + gift: ApiSavedStarGift; + }) & WithTabId; closeGiftInfoModal: WithTabId | undefined; + closeGiftResalePriceComposerModal: WithTabId | undefined; openGiftUpgradeModal: { giftId: string; @@ -2465,6 +2474,9 @@ export interface ActionPayloads { peerId: string; shouldRefresh?: boolean; } & WithTabId; + reloadPeerSavedGifts: { + peerId: string; + }; changeGiftVisibility: { gift: ApiInputSavedStarGift; shouldUnsave?: boolean; @@ -2477,6 +2489,11 @@ export interface ActionPayloads { gift: ApiSavedStarGift; } & WithTabId; + updateStarGiftPrice: { + gift: ApiInputSavedStarGift; + price: number; + } & WithTabId; + openStarsGiftModal: ({ chatId?: string; forUserId?: string; diff --git a/src/global/types/tabState.ts b/src/global/types/tabState.ts index 72f43b7ec..071c0911f 100644 --- a/src/global/types/tabState.ts +++ b/src/global/types/tabState.ts @@ -764,6 +764,11 @@ export type TabState = { gift: ApiSavedStarGift | ApiStarGift; }; + giftResalePriceComposerModal?: { + peerId?: string; + gift: ApiSavedStarGift | ApiStarGift; + }; + giftTransferModal?: { gift: ApiSavedStarGift; }; diff --git a/src/lib/gramjs/tl/AllTLObjects.ts b/src/lib/gramjs/tl/AllTLObjects.ts index cc0c1dcb4..2b6fe4833 100644 --- a/src/lib/gramjs/tl/AllTLObjects.ts +++ b/src/lib/gramjs/tl/AllTLObjects.ts @@ -12,5 +12,5 @@ for (const tl of Object.values(Api)) { } } -export const LAYER = 201; +export const LAYER = 203; export { tlobjects }; diff --git a/src/lib/gramjs/tl/api.d.ts b/src/lib/gramjs/tl/api.d.ts index 9a2ea4328..397150f09 100644 --- a/src/lib/gramjs/tl/api.d.ts +++ b/src/lib/gramjs/tl/api.d.ts @@ -69,7 +69,7 @@ namespace Api { export type TypeChatPhoto = ChatPhotoEmpty | ChatPhoto; export type TypeMessage = MessageEmpty | Message | MessageService; export type TypeMessageMedia = MessageMediaEmpty | MessageMediaPhoto | MessageMediaGeo | MessageMediaContact | MessageMediaUnsupported | MessageMediaDocument | MessageMediaWebPage | MessageMediaVenue | MessageMediaGame | MessageMediaInvoice | MessageMediaGeoLive | MessageMediaPoll | MessageMediaDice | MessageMediaStory | MessageMediaGiveaway | MessageMediaGiveawayResults | MessageMediaPaidMedia; - export type TypeMessageAction = MessageActionEmpty | MessageActionChatCreate | MessageActionChatEditTitle | MessageActionChatEditPhoto | MessageActionChatDeletePhoto | MessageActionChatAddUser | MessageActionChatDeleteUser | MessageActionChatJoinedByLink | MessageActionChannelCreate | MessageActionChatMigrateTo | MessageActionChannelMigrateFrom | MessageActionPinMessage | MessageActionHistoryClear | MessageActionGameScore | MessageActionPaymentSentMe | MessageActionPaymentSent | MessageActionPhoneCall | MessageActionScreenshotTaken | MessageActionCustomAction | MessageActionBotAllowed | MessageActionSecureValuesSentMe | MessageActionSecureValuesSent | MessageActionContactSignUp | MessageActionGeoProximityReached | MessageActionGroupCall | MessageActionInviteToGroupCall | MessageActionSetMessagesTTL | MessageActionGroupCallScheduled | MessageActionSetChatTheme | MessageActionChatJoinedByRequest | MessageActionWebViewDataSentMe | MessageActionWebViewDataSent | MessageActionGiftPremium | MessageActionTopicCreate | MessageActionTopicEdit | MessageActionSuggestProfilePhoto | MessageActionRequestedPeer | MessageActionSetChatWallPaper | MessageActionGiftCode | MessageActionGiveawayLaunch | MessageActionGiveawayResults | MessageActionBoostApply | MessageActionRequestedPeerSentMe | MessageActionPaymentRefunded | MessageActionGiftStars | MessageActionPrizeStars | MessageActionStarGift | MessageActionStarGiftUnique | MessageActionPaidMessagesRefunded | MessageActionPaidMessagesPrice; + export type TypeMessageAction = MessageActionEmpty | MessageActionChatCreate | MessageActionChatEditTitle | MessageActionChatEditPhoto | MessageActionChatDeletePhoto | MessageActionChatAddUser | MessageActionChatDeleteUser | MessageActionChatJoinedByLink | MessageActionChannelCreate | MessageActionChatMigrateTo | MessageActionChannelMigrateFrom | MessageActionPinMessage | MessageActionHistoryClear | MessageActionGameScore | MessageActionPaymentSentMe | MessageActionPaymentSent | MessageActionPhoneCall | MessageActionScreenshotTaken | MessageActionCustomAction | MessageActionBotAllowed | MessageActionSecureValuesSentMe | MessageActionSecureValuesSent | MessageActionContactSignUp | MessageActionGeoProximityReached | MessageActionGroupCall | MessageActionInviteToGroupCall | MessageActionSetMessagesTTL | MessageActionGroupCallScheduled | MessageActionSetChatTheme | MessageActionChatJoinedByRequest | MessageActionWebViewDataSentMe | MessageActionWebViewDataSent | MessageActionGiftPremium | MessageActionTopicCreate | MessageActionTopicEdit | MessageActionSuggestProfilePhoto | MessageActionRequestedPeer | MessageActionSetChatWallPaper | MessageActionGiftCode | MessageActionGiveawayLaunch | MessageActionGiveawayResults | MessageActionBoostApply | MessageActionRequestedPeerSentMe | MessageActionPaymentRefunded | MessageActionGiftStars | MessageActionPrizeStars | MessageActionStarGift | MessageActionStarGiftUnique | MessageActionPaidMessagesRefunded | MessageActionPaidMessagesPrice | MessageActionConferenceCall; export type TypeDialog = Dialog | DialogFolder; export type TypePhoto = PhotoEmpty | Photo; export type TypePhotoSize = PhotoSizeEmpty | PhotoSize | PhotoCachedSize | PhotoStrippedSize | PhotoSizeProgressive | PhotoPathSize; @@ -85,7 +85,7 @@ namespace Api { export type TypeImportedContact = ImportedContact; export type TypeContactStatus = ContactStatus; export type TypeMessagesFilter = InputMessagesFilterEmpty | InputMessagesFilterPhotos | InputMessagesFilterVideo | InputMessagesFilterPhotoVideo | InputMessagesFilterDocument | InputMessagesFilterUrl | InputMessagesFilterGif | InputMessagesFilterVoice | InputMessagesFilterMusic | InputMessagesFilterChatPhotos | InputMessagesFilterPhoneCalls | InputMessagesFilterRoundVoice | InputMessagesFilterRoundVideo | InputMessagesFilterMyMentions | InputMessagesFilterGeo | InputMessagesFilterContacts | InputMessagesFilterPinned; - export type TypeUpdate = UpdateNewMessage | UpdateMessageID | UpdateDeleteMessages | UpdateUserTyping | UpdateChatUserTyping | UpdateChatParticipants | UpdateUserStatus | UpdateUserName | UpdateNewAuthorization | UpdateNewEncryptedMessage | UpdateEncryptedChatTyping | UpdateEncryption | UpdateEncryptedMessagesRead | UpdateChatParticipantAdd | UpdateChatParticipantDelete | UpdateDcOptions | UpdateNotifySettings | UpdateServiceNotification | UpdatePrivacy | UpdateUserPhone | UpdateReadHistoryInbox | UpdateReadHistoryOutbox | UpdateWebPage | UpdateReadMessagesContents | UpdateChannelTooLong | UpdateChannel | UpdateNewChannelMessage | UpdateReadChannelInbox | UpdateDeleteChannelMessages | UpdateChannelMessageViews | UpdateChatParticipantAdmin | UpdateNewStickerSet | UpdateStickerSetsOrder | UpdateStickerSets | UpdateSavedGifs | UpdateBotInlineQuery | UpdateBotInlineSend | UpdateEditChannelMessage | UpdateBotCallbackQuery | UpdateEditMessage | UpdateInlineBotCallbackQuery | UpdateReadChannelOutbox | UpdateDraftMessage | UpdateReadFeaturedStickers | UpdateRecentStickers | UpdateConfig | UpdatePtsChanged | UpdateChannelWebPage | UpdateDialogPinned | UpdatePinnedDialogs | UpdateBotWebhookJSON | UpdateBotWebhookJSONQuery | UpdateBotShippingQuery | UpdateBotPrecheckoutQuery | UpdatePhoneCall | UpdateLangPackTooLong | UpdateLangPack | UpdateFavedStickers | UpdateChannelReadMessagesContents | UpdateContactsReset | UpdateChannelAvailableMessages | UpdateDialogUnreadMark | UpdateMessagePoll | UpdateChatDefaultBannedRights | UpdateFolderPeers | UpdatePeerSettings | UpdatePeerLocated | UpdateNewScheduledMessage | UpdateDeleteScheduledMessages | UpdateTheme | UpdateGeoLiveViewed | UpdateLoginToken | UpdateMessagePollVote | UpdateDialogFilter | UpdateDialogFilterOrder | UpdateDialogFilters | UpdatePhoneCallSignalingData | UpdateChannelMessageForwards | UpdateReadChannelDiscussionInbox | UpdateReadChannelDiscussionOutbox | UpdatePeerBlocked | UpdateChannelUserTyping | UpdatePinnedMessages | UpdatePinnedChannelMessages | UpdateChat | UpdateGroupCallParticipants | UpdateGroupCall | UpdatePeerHistoryTTL | UpdateChatParticipant | UpdateChannelParticipant | UpdateBotStopped | UpdateGroupCallConnection | UpdateBotCommands | UpdatePendingJoinRequests | UpdateBotChatInviteRequester | UpdateMessageReactions | UpdateAttachMenuBots | UpdateWebViewResultSent | UpdateBotMenuButton | UpdateSavedRingtones | UpdateTranscribedAudio | UpdateReadFeaturedEmojiStickers | UpdateUserEmojiStatus | UpdateRecentEmojiStatuses | UpdateRecentReactions | UpdateMoveStickerSetToTop | UpdateMessageExtendedMedia | UpdateChannelPinnedTopic | UpdateChannelPinnedTopics | UpdateUser | UpdateAutoSaveSettings | UpdateStory | UpdateReadStories | UpdateStoryID | UpdateStoriesStealthMode | UpdateSentStoryReaction | UpdateBotChatBoost | UpdateChannelViewForumAsMessages | UpdatePeerWallpaper | UpdateBotMessageReaction | UpdateBotMessageReactions | UpdateSavedDialogPinned | UpdatePinnedSavedDialogs | UpdateSavedReactionTags | UpdateSmsJob | UpdateQuickReplies | UpdateNewQuickReply | UpdateDeleteQuickReply | UpdateQuickReplyMessage | UpdateDeleteQuickReplyMessages | UpdateBotBusinessConnect | UpdateBotNewBusinessMessage | UpdateBotEditBusinessMessage | UpdateBotDeleteBusinessMessage | UpdateNewStoryReaction | UpdateBroadcastRevenueTransactions | UpdateStarsBalance | UpdateBusinessBotCallbackQuery | UpdateStarsRevenueStatus | UpdateBotPurchasedPaidMedia | UpdatePaidReactionPrivacy | UpdateSentPhoneCode; + export type TypeUpdate = UpdateNewMessage | UpdateMessageID | UpdateDeleteMessages | UpdateUserTyping | UpdateChatUserTyping | UpdateChatParticipants | UpdateUserStatus | UpdateUserName | UpdateNewAuthorization | UpdateNewEncryptedMessage | UpdateEncryptedChatTyping | UpdateEncryption | UpdateEncryptedMessagesRead | UpdateChatParticipantAdd | UpdateChatParticipantDelete | UpdateDcOptions | UpdateNotifySettings | UpdateServiceNotification | UpdatePrivacy | UpdateUserPhone | UpdateReadHistoryInbox | UpdateReadHistoryOutbox | UpdateWebPage | UpdateReadMessagesContents | UpdateChannelTooLong | UpdateChannel | UpdateNewChannelMessage | UpdateReadChannelInbox | UpdateDeleteChannelMessages | UpdateChannelMessageViews | UpdateChatParticipantAdmin | UpdateNewStickerSet | UpdateStickerSetsOrder | UpdateStickerSets | UpdateSavedGifs | UpdateBotInlineQuery | UpdateBotInlineSend | UpdateEditChannelMessage | UpdateBotCallbackQuery | UpdateEditMessage | UpdateInlineBotCallbackQuery | UpdateReadChannelOutbox | UpdateDraftMessage | UpdateReadFeaturedStickers | UpdateRecentStickers | UpdateConfig | UpdatePtsChanged | UpdateChannelWebPage | UpdateDialogPinned | UpdatePinnedDialogs | UpdateBotWebhookJSON | UpdateBotWebhookJSONQuery | UpdateBotShippingQuery | UpdateBotPrecheckoutQuery | UpdatePhoneCall | UpdateLangPackTooLong | UpdateLangPack | UpdateFavedStickers | UpdateChannelReadMessagesContents | UpdateContactsReset | UpdateChannelAvailableMessages | UpdateDialogUnreadMark | UpdateMessagePoll | UpdateChatDefaultBannedRights | UpdateFolderPeers | UpdatePeerSettings | UpdatePeerLocated | UpdateNewScheduledMessage | UpdateDeleteScheduledMessages | UpdateTheme | UpdateGeoLiveViewed | UpdateLoginToken | UpdateMessagePollVote | UpdateDialogFilter | UpdateDialogFilterOrder | UpdateDialogFilters | UpdatePhoneCallSignalingData | UpdateChannelMessageForwards | UpdateReadChannelDiscussionInbox | UpdateReadChannelDiscussionOutbox | UpdatePeerBlocked | UpdateChannelUserTyping | UpdatePinnedMessages | UpdatePinnedChannelMessages | UpdateChat | UpdateGroupCallParticipants | UpdateGroupCall | UpdatePeerHistoryTTL | UpdateChatParticipant | UpdateChannelParticipant | UpdateBotStopped | UpdateGroupCallConnection | UpdateBotCommands | UpdatePendingJoinRequests | UpdateBotChatInviteRequester | UpdateMessageReactions | UpdateAttachMenuBots | UpdateWebViewResultSent | UpdateBotMenuButton | UpdateSavedRingtones | UpdateTranscribedAudio | UpdateReadFeaturedEmojiStickers | UpdateUserEmojiStatus | UpdateRecentEmojiStatuses | UpdateRecentReactions | UpdateMoveStickerSetToTop | UpdateMessageExtendedMedia | UpdateChannelPinnedTopic | UpdateChannelPinnedTopics | UpdateUser | UpdateAutoSaveSettings | UpdateStory | UpdateReadStories | UpdateStoryID | UpdateStoriesStealthMode | UpdateSentStoryReaction | UpdateBotChatBoost | UpdateChannelViewForumAsMessages | UpdatePeerWallpaper | UpdateBotMessageReaction | UpdateBotMessageReactions | UpdateSavedDialogPinned | UpdatePinnedSavedDialogs | UpdateSavedReactionTags | UpdateSmsJob | UpdateQuickReplies | UpdateNewQuickReply | UpdateDeleteQuickReply | UpdateQuickReplyMessage | UpdateDeleteQuickReplyMessages | UpdateBotBusinessConnect | UpdateBotNewBusinessMessage | UpdateBotEditBusinessMessage | UpdateBotDeleteBusinessMessage | UpdateNewStoryReaction | UpdateBroadcastRevenueTransactions | UpdateStarsBalance | UpdateBusinessBotCallbackQuery | UpdateStarsRevenueStatus | UpdateBotPurchasedPaidMedia | UpdatePaidReactionPrivacy | UpdateSentPhoneCode | UpdateGroupCallChainBlocks; export type TypeUpdates = UpdatesTooLong | UpdateShortMessage | UpdateShortChatMessage | UpdateShort | UpdatesCombined | Updates | UpdateShortSentMessage; export type TypeDcOption = DcOption; export type TypeConfig = Config; @@ -144,7 +144,7 @@ namespace Api { export type TypeHighScore = HighScore; export type TypeRichText = TextEmpty | TextPlain | TextBold | TextItalic | TextUnderline | TextStrike | TextFixed | TextUrl | TextEmail | TextConcat | TextSubscript | TextSuperscript | TextMarked | TextPhone | TextImage | TextAnchor; export type TypePageBlock = PageBlockUnsupported | PageBlockTitle | PageBlockSubtitle | PageBlockAuthorDate | PageBlockHeader | PageBlockSubheader | PageBlockParagraph | PageBlockPreformatted | PageBlockFooter | PageBlockDivider | PageBlockAnchor | PageBlockList | PageBlockBlockquote | PageBlockPullquote | PageBlockPhoto | PageBlockVideo | PageBlockCover | PageBlockEmbed | PageBlockEmbedPost | PageBlockCollage | PageBlockSlideshow | PageBlockChannel | PageBlockAudio | PageBlockKicker | PageBlockTable | PageBlockOrderedList | PageBlockDetails | PageBlockRelatedArticles | PageBlockMap; - export type TypePhoneCallDiscardReason = PhoneCallDiscardReasonMissed | PhoneCallDiscardReasonDisconnect | PhoneCallDiscardReasonHangup | PhoneCallDiscardReasonBusy; + export type TypePhoneCallDiscardReason = PhoneCallDiscardReasonMissed | PhoneCallDiscardReasonDisconnect | PhoneCallDiscardReasonHangup | PhoneCallDiscardReasonBusy | PhoneCallDiscardReasonMigrateConferenceCall; export type TypeDataJSON = DataJSON; export type TypeLabeledPrice = LabeledPrice; export type TypeInvoice = Invoice; @@ -167,7 +167,7 @@ namespace Api { export type TypeLangPackString = LangPackString | LangPackStringPluralized | LangPackStringDeleted; export type TypeLangPackDifference = LangPackDifference; export type TypeLangPackLanguage = LangPackLanguage; - export type TypeChannelAdminLogEventAction = ChannelAdminLogEventActionChangeTitle | ChannelAdminLogEventActionChangeAbout | ChannelAdminLogEventActionChangeUsername | ChannelAdminLogEventActionChangePhoto | ChannelAdminLogEventActionToggleInvites | ChannelAdminLogEventActionToggleSignatures | ChannelAdminLogEventActionUpdatePinned | ChannelAdminLogEventActionEditMessage | ChannelAdminLogEventActionDeleteMessage | ChannelAdminLogEventActionParticipantJoin | ChannelAdminLogEventActionParticipantLeave | ChannelAdminLogEventActionParticipantInvite | ChannelAdminLogEventActionParticipantToggleBan | ChannelAdminLogEventActionParticipantToggleAdmin | ChannelAdminLogEventActionChangeStickerSet | ChannelAdminLogEventActionTogglePreHistoryHidden | ChannelAdminLogEventActionDefaultBannedRights | ChannelAdminLogEventActionStopPoll | ChannelAdminLogEventActionChangeLinkedChat | ChannelAdminLogEventActionChangeLocation | ChannelAdminLogEventActionToggleSlowMode | ChannelAdminLogEventActionStartGroupCall | ChannelAdminLogEventActionDiscardGroupCall | ChannelAdminLogEventActionParticipantMute | ChannelAdminLogEventActionParticipantUnmute | ChannelAdminLogEventActionToggleGroupCallSetting | ChannelAdminLogEventActionParticipantJoinByInvite | ChannelAdminLogEventActionExportedInviteDelete | ChannelAdminLogEventActionExportedInviteRevoke | ChannelAdminLogEventActionExportedInviteEdit | ChannelAdminLogEventActionParticipantVolume | ChannelAdminLogEventActionChangeHistoryTTL | ChannelAdminLogEventActionParticipantJoinByRequest | ChannelAdminLogEventActionToggleNoForwards | ChannelAdminLogEventActionSendMessage | ChannelAdminLogEventActionChangeAvailableReactions | ChannelAdminLogEventActionChangeUsernames | ChannelAdminLogEventActionToggleForum | ChannelAdminLogEventActionCreateTopic | ChannelAdminLogEventActionEditTopic | ChannelAdminLogEventActionDeleteTopic | ChannelAdminLogEventActionPinTopic | ChannelAdminLogEventActionToggleAntiSpam | ChannelAdminLogEventActionChangePeerColor | ChannelAdminLogEventActionChangeProfilePeerColor | ChannelAdminLogEventActionChangeWallpaper | ChannelAdminLogEventActionChangeEmojiStatus | ChannelAdminLogEventActionChangeEmojiStickerSet | ChannelAdminLogEventActionToggleSignatureProfiles | ChannelAdminLogEventActionParticipantSubExtend; + export type TypeChannelAdminLogEventAction = ChannelAdminLogEventActionChangeTitle | ChannelAdminLogEventActionChangeAbout | ChannelAdminLogEventActionChangeUsername | ChannelAdminLogEventActionChangePhoto | ChannelAdminLogEventActionToggleInvites | ChannelAdminLogEventActionToggleSignatures | ChannelAdminLogEventActionUpdatePinned | ChannelAdminLogEventActionEditMessage | ChannelAdminLogEventActionDeleteMessage | ChannelAdminLogEventActionParticipantJoin | ChannelAdminLogEventActionParticipantLeave | ChannelAdminLogEventActionParticipantInvite | ChannelAdminLogEventActionParticipantToggleBan | ChannelAdminLogEventActionParticipantToggleAdmin | ChannelAdminLogEventActionChangeStickerSet | ChannelAdminLogEventActionTogglePreHistoryHidden | ChannelAdminLogEventActionDefaultBannedRights | ChannelAdminLogEventActionStopPoll | ChannelAdminLogEventActionChangeLinkedChat | ChannelAdminLogEventActionChangeLocation | ChannelAdminLogEventActionToggleSlowMode | ChannelAdminLogEventActionStartGroupCall | ChannelAdminLogEventActionDiscardGroupCall | ChannelAdminLogEventActionParticipantMute | ChannelAdminLogEventActionParticipantUnmute | ChannelAdminLogEventActionToggleGroupCallSetting | ChannelAdminLogEventActionParticipantJoinByInvite | ChannelAdminLogEventActionExportedInviteDelete | ChannelAdminLogEventActionExportedInviteRevoke | ChannelAdminLogEventActionExportedInviteEdit | ChannelAdminLogEventActionParticipantVolume | ChannelAdminLogEventActionChangeHistoryTTL | ChannelAdminLogEventActionParticipantJoinByRequest | ChannelAdminLogEventActionToggleNoForwards | ChannelAdminLogEventActionSendMessage | ChannelAdminLogEventActionChangeAvailableReactions | ChannelAdminLogEventActionChangeUsernames | ChannelAdminLogEventActionToggleForum | ChannelAdminLogEventActionCreateTopic | ChannelAdminLogEventActionEditTopic | ChannelAdminLogEventActionDeleteTopic | ChannelAdminLogEventActionPinTopic | ChannelAdminLogEventActionToggleAntiSpam | ChannelAdminLogEventActionChangePeerColor | ChannelAdminLogEventActionChangeProfilePeerColor | ChannelAdminLogEventActionChangeWallpaper | ChannelAdminLogEventActionChangeEmojiStatus | ChannelAdminLogEventActionChangeEmojiStickerSet | ChannelAdminLogEventActionToggleSignatureProfiles | ChannelAdminLogEventActionParticipantSubExtend | ChannelAdminLogEventActionToggleAutotranslation; export type TypeChannelAdminLogEvent = ChannelAdminLogEvent; export type TypeChannelAdminLogEventsFilter = ChannelAdminLogEventsFilter; export type TypePopularContact = PopularContact; @@ -251,7 +251,7 @@ namespace Api { export type TypeMessageReplies = MessageReplies; export type TypePeerBlocked = PeerBlocked; export type TypeGroupCall = GroupCallDiscarded | GroupCall; - export type TypeInputGroupCall = InputGroupCall; + export type TypeInputGroupCall = InputGroupCall | InputGroupCallSlug | InputGroupCallInviteMessage; export type TypeGroupCallParticipant = GroupCallParticipant; export type TypeInlineQueryPeerType = InlineQueryPeerTypeSameBotPM | InlineQueryPeerTypePM | InlineQueryPeerTypeChat | InlineQueryPeerTypeMegagroup | InlineQueryPeerTypeBroadcast | InlineQueryPeerTypeBotPM; export type TypeChatInviteImporter = ChatInviteImporter; @@ -277,7 +277,7 @@ namespace Api { export type TypeBotMenuButton = BotMenuButtonDefault | BotMenuButtonCommands | BotMenuButton; export type TypeNotificationSound = NotificationSoundDefault | NotificationSoundNone | NotificationSoundLocal | NotificationSoundRingtone; export type TypeAttachMenuPeerType = AttachMenuPeerTypeSameBotPM | AttachMenuPeerTypeBotPM | AttachMenuPeerTypePM | AttachMenuPeerTypeChat | AttachMenuPeerTypeBroadcast; - export type TypeInputInvoice = InputInvoiceMessage | InputInvoiceSlug | InputInvoicePremiumGiftCode | InputInvoiceStars | InputInvoiceChatInviteSubscription | InputInvoiceStarGift | InputInvoiceStarGiftUpgrade | InputInvoiceStarGiftTransfer | InputInvoicePremiumGiftStars | InputInvoiceBusinessBotTransferStars; + export type TypeInputInvoice = InputInvoiceMessage | InputInvoiceSlug | InputInvoicePremiumGiftCode | InputInvoiceStars | InputInvoiceChatInviteSubscription | InputInvoiceStarGift | InputInvoiceStarGiftUpgrade | InputInvoiceStarGiftTransfer | InputInvoicePremiumGiftStars | InputInvoiceBusinessBotTransferStars | InputInvoiceStarGiftResale; export type TypeInputStorePaymentPurpose = InputStorePaymentPremiumSubscription | InputStorePaymentGiftPremium | InputStorePaymentPremiumGiftCode | InputStorePaymentPremiumGiveaway | InputStorePaymentStarsTopup | InputStorePaymentStarsGift | InputStorePaymentStarsGiveaway | InputStorePaymentAuthCode; export type TypePaymentFormMethod = PaymentFormMethod; export type TypeEmojiStatus = EmojiStatusEmpty | EmojiStatus | EmojiStatusCollectible | InputEmojiStatusCollectible; @@ -386,12 +386,15 @@ namespace Api { export type TypeBotVerification = BotVerification; export type TypeStarGiftAttribute = StarGiftAttributeModel | StarGiftAttributePattern | StarGiftAttributeBackdrop | StarGiftAttributeOriginalDetails; export type TypeSavedStarGift = SavedStarGift; - export type TypeInputSavedStarGift = InputSavedStarGiftUser | InputSavedStarGiftChat; + export type TypeInputSavedStarGift = InputSavedStarGiftUser | InputSavedStarGiftChat | InputSavedStarGiftSlug; export type TypePaidReactionPrivacy = PaidReactionPrivacyDefault | PaidReactionPrivacyAnonymous | PaidReactionPrivacyPeer; export type TypeRequirementToContact = RequirementToContactEmpty | RequirementToContactPremium | RequirementToContactPaidMessages; export type TypeBusinessBotRights = BusinessBotRights; export type TypeDisallowedGiftsSettings = DisallowedGiftsSettings; export type TypeSponsoredPeer = SponsoredPeer; + export type TypeStarGiftAttributeId = StarGiftAttributeIdModel | StarGiftAttributeIdPattern | StarGiftAttributeIdBackdrop; + export type TypeStarGiftAttributeCounter = StarGiftAttributeCounter; + export type TypePendingSuggestion = PendingSuggestion; export type TypeResPQ = ResPQ; export type TypeP_Q_inner_data = PQInnerData | PQInnerDataDc | PQInnerDataTemp | PQInnerDataTempDc; export type TypeServer_DH_Params = ServerDHParamsFail | ServerDHParamsOk; @@ -606,6 +609,7 @@ namespace Api { export type TypeUniqueStarGift = payments.UniqueStarGift; export type TypeSavedStarGifts = payments.SavedStarGifts; export type TypeStarGiftWithdrawalUrl = payments.StarGiftWithdrawalUrl; + export type TypeResaleStarGifts = payments.ResaleStarGifts; } export namespace phone { @@ -659,6 +663,7 @@ namespace Api { export type TypePeerStories = stories.PeerStories; export type TypeStoryReactionsList = stories.StoryReactionsList; export type TypeFoundStories = stories.FoundStories; + export type TypeCanSendStoryCount = stories.CanSendStoryCount; } export namespace premium { @@ -1704,6 +1709,7 @@ namespace Api { storiesHiddenMin?: true; storiesUnavailable?: true; signatureProfiles?: true; + autotranslation?: true; id: long; accessHash?: long; title: string; @@ -1751,6 +1757,7 @@ namespace Api { storiesHiddenMin?: true; storiesUnavailable?: true; signatureProfiles?: true; + autotranslation?: true; id: long; accessHash?: long; title: string; @@ -3187,6 +3194,9 @@ namespace Api { fromId?: Api.TypePeer; peer?: Api.TypePeer; savedId?: long; + resaleStars?: long; + canTransferAt?: int; + canResellAt?: int; }> { // flags: Api.Type; upgrade?: true; @@ -3199,10 +3209,12 @@ namespace Api { fromId?: Api.TypePeer; peer?: Api.TypePeer; savedId?: long; + resaleStars?: long; + canTransferAt?: int; + canResellAt?: int; CONSTRUCTOR_ID: 2900347777; SUBCLASS_OF_ID: 2256589094; className: 'MessageActionStarGiftUnique'; - static fromReader(reader: Reader): MessageActionStarGiftUnique; } export class MessageActionPaidMessagesRefunded extends VirtualClass<{ @@ -3227,6 +3239,24 @@ namespace Api { static fromReader(reader: Reader): MessageActionPaidMessagesPrice; } + export class MessageActionConferenceCall extends VirtualClass<{ + // flags: Api.Type; + missed?: true; + active?: true; + video?: true; + callId: long; + duration?: int; + otherParticipants?: Api.TypePeer[]; + }> { + // flags: Api.Type; + missed?: true; + active?: true; + video?: true; + callId: long; + duration?: int; + otherParticipants?: Api.TypePeer[]; + static fromReader(reader: Reader): MessageActionConferenceCall; + } export class Dialog extends VirtualClass<{ // flags: Api.Type; pinned?: true; @@ -5911,6 +5941,18 @@ namespace Api { static fromReader(reader: Reader): UpdateSentPhoneCode; } + export class UpdateGroupCallChainBlocks extends VirtualClass<{ + call: Api.TypeInputGroupCall; + subChainId: int; + blocks: bytes[]; + nextOffset: int; + }> { + call: Api.TypeInputGroupCall; + subChainId: int; + blocks: bytes[]; + nextOffset: int; + static fromReader(reader: Reader): UpdateGroupCallChainBlocks; + } export class UpdatesTooLong extends VirtualClass { CONSTRUCTOR_ID: 3809980286; SUBCLASS_OF_ID: 2331323052; @@ -9858,6 +9900,12 @@ namespace Api { static fromReader(reader: Reader): PhoneCallDiscardReasonBusy; } + export class PhoneCallDiscardReasonMigrateConferenceCall extends VirtualClass<{ + slug: string; + }> { + slug: string; + static fromReader(reader: Reader): PhoneCallDiscardReasonMigrateConferenceCall; + } export class DataJSON extends VirtualClass<{ data: string; }> { @@ -10192,7 +10240,6 @@ namespace Api { participantId: long; protocol: Api.TypePhoneCallProtocol; receiveDate?: int; - conferenceCall?: Api.TypeInputGroupCall; }> { // flags: Api.Type; video?: true; @@ -10220,7 +10267,6 @@ namespace Api { participantId: long; gAHash: bytes; protocol: Api.TypePhoneCallProtocol; - conferenceCall?: Api.TypeInputGroupCall; }> { // flags: Api.Type; video?: true; @@ -10248,7 +10294,6 @@ namespace Api { participantId: long; gB: bytes; protocol: Api.TypePhoneCallProtocol; - conferenceCall?: Api.TypeInputGroupCall; }> { // flags: Api.Type; video?: true; @@ -10270,6 +10315,7 @@ namespace Api { // flags: Api.Type; p2pAllowed?: true; video?: true; + conferenceSupported?: true; id: long; accessHash: long; date: int; @@ -10281,11 +10327,11 @@ namespace Api { connections: Api.TypePhoneConnection[]; startDate: int; customParameters?: Api.TypeDataJSON; - conferenceCall?: Api.TypeInputGroupCall; }> { // flags: Api.Type; p2pAllowed?: true; video?: true; + conferenceSupported?: true; id: long; accessHash: long; date: int; @@ -10312,7 +10358,6 @@ namespace Api { id: long; reason?: Api.TypePhoneCallDiscardReason; duration?: int; - conferenceCall?: Api.TypeInputGroupCall; }> { // flags: Api.Type; needRating?: true; @@ -11062,6 +11107,12 @@ namespace Api { static fromReader(reader: Reader): ChannelAdminLogEventActionParticipantSubExtend; } + export class ChannelAdminLogEventActionToggleAutotranslation extends VirtualClass<{ + newValue: Bool; + }> { + newValue: Bool; + static fromReader(reader: Reader): ChannelAdminLogEventActionToggleAutotranslation; + } export class ChannelAdminLogEvent extends VirtualClass<{ id: long; date: int; @@ -13195,6 +13246,8 @@ namespace Api { recordVideoActive?: true; rtmpStream?: true; listenersHidden?: true; + conference?: true; + creator?: true; id: long; accessHash: long; participantsCount: int; @@ -13205,7 +13258,7 @@ namespace Api { unmutedVideoCount?: int; unmutedVideoLimit: int; version: int; - conferenceFromCall?: long; + inviteLink?: string; }> { // flags: Api.Type; joinMuted?: true; @@ -13216,6 +13269,8 @@ namespace Api { recordVideoActive?: true; rtmpStream?: true; listenersHidden?: true; + conference?: true; + creator?: true; id: long; accessHash: long; participantsCount: int; @@ -13227,10 +13282,10 @@ namespace Api { unmutedVideoLimit: int; version: int; conferenceFromCall?: long; + inviteLink?: string; CONSTRUCTOR_ID: 3455636451; SUBCLASS_OF_ID: 548729632; className: 'GroupCall'; - static fromReader(reader: Reader): GroupCall; } export class InputGroupCall extends VirtualClass<{ @@ -13245,6 +13300,18 @@ namespace Api { static fromReader(reader: Reader): InputGroupCall; } + export class InputGroupCallSlug extends VirtualClass<{ + slug: string; + }> { + slug: string; + static fromReader(reader: Reader): InputGroupCallSlug; + } + export class InputGroupCallInviteMessage extends VirtualClass<{ + msgId: int; + }> { + msgId: int; + static fromReader(reader: Reader): InputGroupCallInviteMessage; + } export class GroupCallParticipant extends VirtualClass<{ // flags: Api.Type; muted?: true; @@ -13979,6 +14046,14 @@ namespace Api { static fromReader(reader: Reader): InputInvoiceBusinessBotTransferStars; } + export class InputInvoiceStarGiftResale extends VirtualClass<{ + slug: string; + toId: Api.TypeInputPeer; + }> { + slug: string; + toId: Api.TypeInputPeer; + static fromReader(reader: Reader): InputInvoiceStarGiftResale; + } export class InputStorePaymentPremiumSubscription extends VirtualClass<{ // flags: Api.Type; restore?: true; @@ -16228,6 +16303,8 @@ namespace Api { gift?: true; reaction?: true; stargiftUpgrade?: true; + businessTransfer?: true; + stargiftResale?: true; id: string; stars: Api.TypeStarsAmount; date: int; @@ -16257,6 +16334,8 @@ namespace Api { gift?: true; reaction?: true; stargiftUpgrade?: true; + businessTransfer?: true; + stargiftResale?: true; id: string; stars: Api.TypeStarsAmount; date: int; @@ -16498,10 +16577,13 @@ namespace Api { stars: long; availabilityRemains?: int; availabilityTotal?: int; + availabilityResale?: long; convertStars: long; firstSaleDate?: int; lastSaleDate?: int; upgradeStars?: long; + resellMinStars?: long; + title?: string; }> { // flags: Api.Type; limited?: true; @@ -16512,14 +16594,16 @@ namespace Api { stars: long; availabilityRemains?: int; availabilityTotal?: int; + availabilityResale?: long; convertStars: long; firstSaleDate?: int; lastSaleDate?: int; upgradeStars?: long; + resellMinStars?: long; + title?: string; CONSTRUCTOR_ID: 46953416; SUBCLASS_OF_ID: 3273414923; className: 'StarGift'; - static fromReader(reader: Reader): StarGift; } export class StarGiftUnique extends VirtualClass<{ @@ -16535,6 +16619,7 @@ namespace Api { availabilityIssued: int; availabilityTotal: int; giftAddress?: string; + resellStars?: long; }> { // flags: Api.Type; id: long; @@ -16548,10 +16633,10 @@ namespace Api { availabilityIssued: int; availabilityTotal: int; giftAddress?: string; + resellStars?: long; CONSTRUCTOR_ID: 1549979985; SUBCLASS_OF_ID: 3273414923; className: 'StarGiftUnique'; - static fromReader(reader: Reader): StarGiftUnique; } export class MessageReportOption extends VirtualClass<{ @@ -16739,6 +16824,7 @@ namespace Api { } export class StarGiftAttributeBackdrop extends VirtualClass<{ name: string; + backdropId: int; centerColor: int; edgeColor: int; patternColor: int; @@ -16746,6 +16832,7 @@ namespace Api { rarityPermille: int; }> { name: string; + backdropId: int; centerColor: int; edgeColor: int; patternColor: int; @@ -16792,6 +16879,8 @@ namespace Api { upgradeStars?: long; canExportAt?: int; transferStars?: long; + canTransferAt?: int; + canResellAt?: int; }> { // flags: Api.Type; nameHidden?: true; @@ -16809,10 +16898,11 @@ namespace Api { upgradeStars?: long; canExportAt?: int; transferStars?: long; + canTransferAt?: int; + canResellAt?: int; CONSTRUCTOR_ID: 1616305061; SUBCLASS_OF_ID: 2385198100; className: 'SavedStarGift'; - static fromReader(reader: Reader): SavedStarGift; } export class InputSavedStarGiftUser extends VirtualClass<{ @@ -16837,6 +16927,12 @@ namespace Api { static fromReader(reader: Reader): InputSavedStarGiftChat; } + export class InputSavedStarGiftSlug extends VirtualClass<{ + slug: string; + }> { + slug: string; + static fromReader(reader: Reader): InputSavedStarGiftSlug; + } export class PaidReactionPrivacyDefault extends VirtualClass { CONSTRUCTOR_ID: 543872158; SUBCLASS_OF_ID: 1708619318; @@ -16959,6 +17055,44 @@ namespace Api { static fromReader(reader: Reader): SponsoredPeer; } + export class StarGiftAttributeIdModel extends VirtualClass<{ + documentId: long; + }> { + documentId: long; + static fromReader(reader: Reader): StarGiftAttributeIdModel; + } + export class StarGiftAttributeIdPattern extends VirtualClass<{ + documentId: long; + }> { + documentId: long; + static fromReader(reader: Reader): StarGiftAttributeIdPattern; + } + export class StarGiftAttributeIdBackdrop extends VirtualClass<{ + backdropId: int; + }> { + backdropId: int; + static fromReader(reader: Reader): StarGiftAttributeIdBackdrop; + } + export class StarGiftAttributeCounter extends VirtualClass<{ + attribute: Api.TypeStarGiftAttributeId; + count: int; + }> { + attribute: Api.TypeStarGiftAttributeId; + count: int; + static fromReader(reader: Reader): StarGiftAttributeCounter; + } + export class PendingSuggestion extends VirtualClass<{ + suggestion: string; + title: Api.TypeTextWithEntities; + description: Api.TypeTextWithEntities; + url: string; + }> { + suggestion: string; + title: Api.TypeTextWithEntities; + description: Api.TypeTextWithEntities; + url: string; + static fromReader(reader: Reader): PendingSuggestion; + } export class ResPQ extends VirtualClass<{ nonce: int128; serverNonce: int128; @@ -19745,24 +19879,29 @@ namespace Api { // flags: Api.Type; proxy?: true; expires: int; - peer: Api.TypePeer; - chats: Api.TypeChat[]; - users: Api.TypeUser[]; + peer?: Api.TypePeer; psaType?: string; psaMessage?: string; + pendingSuggestions: string[]; + dismissedSuggestions: string[]; + customPendingSuggestion?: Api.TypePendingSuggestion; + chats: Api.TypeChat[]; + users: Api.TypeUser[]; }> { // flags: Api.Type; proxy?: true; expires: int; - peer: Api.TypePeer; - chats: Api.TypeChat[]; - users: Api.TypeUser[]; + peer?: Api.TypePeer; psaType?: string; psaMessage?: string; + pendingSuggestions: string[]; + dismissedSuggestions: string[]; + customPendingSuggestion?: Api.TypePendingSuggestion; + chats: Api.TypeChat[]; + users: Api.TypeUser[]; CONSTRUCTOR_ID: 2352576831; SUBCLASS_OF_ID: 2639877442; className: 'PromoData'; - static fromReader(reader: Reader): PromoData; } export class CountryCode extends VirtualClass<{ @@ -20922,6 +21061,28 @@ namespace Api { static fromReader(reader: Reader): StarGiftWithdrawalUrl; } + export class ResaleStarGifts extends VirtualClass<{ + // flags: Api.Type; + count: int; + gifts: Api.TypeStarGift[]; + nextOffset?: string; + attributes?: Api.TypeStarGiftAttribute[]; + attributesHash?: long; + chats: Api.TypeChat[]; + counters?: Api.TypeStarGiftAttributeCounter[]; + users: Api.TypeUser[]; + }> { + // flags: Api.Type; + count: int; + gifts: Api.TypeStarGift[]; + nextOffset?: string; + attributes?: Api.TypeStarGiftAttribute[]; + attributesHash?: long; + chats: Api.TypeChat[]; + counters?: Api.TypeStarGiftAttributeCounter[]; + users: Api.TypeUser[]; + static fromReader(reader: Reader): ResaleStarGifts; + } } export namespace phone { @@ -21531,6 +21692,12 @@ namespace Api { static fromReader(reader: Reader): FoundStories; } + export class CanSendStoryCount extends VirtualClass<{ + countRemains: int; + }> { + countRemains: int; + static fromReader(reader: Reader): CanSendStoryCount; + } } export namespace premium { @@ -25991,6 +26158,13 @@ namespace Api { channel: Api.TypeInputChannel; sendPaidMessagesStars: long; } + export class ToggleAutotranslation extends Request, Api.TypeUpdates> { + channel: Api.TypeInputChannel; + enabled: Bool; + } } export namespace bots { @@ -26607,6 +26781,32 @@ namespace Api { }>, Bool> { purpose: Api.TypeInputStorePaymentPurpose; } + export class GetResaleStarGifts extends Request, payments.TypeResaleStarGifts> { + // flags: Api.Type; + sortByPrice?: true; + sortByNum?: true; + attributesHash?: long; + giftId: long; + attributes?: Api.TypeStarGiftAttributeId[]; + offset: string; + limit: int; + } + export class UpdateStarGiftPrice extends Request, Api.TypeUpdates> { + stargift: Api.TypeInputSavedStarGift; + resellStars: long; + } } export namespace stickers { @@ -26713,7 +26913,6 @@ namespace Api { // flags: Api.Type; video?: true; userId: Api.TypeInputUser; - conferenceCall?: Api.TypeInputGroupCall; randomId: int; gAHash: bytes; protocol: Api.TypePhoneCallProtocol; @@ -26721,7 +26920,6 @@ namespace Api { // flags: Api.Type; video?: true; userId: Api.TypeInputUser; - conferenceCall?: Api.TypeInputGroupCall; randomId: int; gAHash: bytes; protocol: Api.TypePhoneCallProtocol; @@ -26815,7 +27013,8 @@ namespace Api { call: Api.TypeInputGroupCall; joinAs: Api.TypeInputPeer; inviteHash?: string; - keyFingerprint?: long; + publicKey?: int256; + block?: bytes; params: Api.TypeDataJSON; }>, Api.TypeUpdates> { // flags: Api.Type; @@ -26824,7 +27023,8 @@ namespace Api { call: Api.TypeInputGroupCall; joinAs: Api.TypeInputPeer; inviteHash?: string; - keyFingerprint?: long; + publicKey?: int256; + block?: bytes; params: Api.TypeDataJSON; } export class LeaveGroupCall extends Request, phone.TypePhoneCall> { - peer: Api.TypeInputPhoneCall; - keyFingerprint: long; + // flags: Api.Type; + muted?: true; + videoStopped?: true; + join?: true; + randomId: int; + publicKey?: int256; + block?: bytes; + params?: Api.TypeDataJSON; + }>, Api.TypeUpdates> { + // flags: Api.Type; + muted?: true; + videoStopped?: true; + join?: true; + randomId: int; + publicKey?: int256; + block?: bytes; + params?: Api.TypeDataJSON; + } + export class DeleteConferenceCallParticipants extends Request, Api.TypeUpdates> { + // flags: Api.Type; + onlyLeft?: true; + kick?: true; + call: Api.TypeInputGroupCall; + ids: long[]; + block: bytes; + } + export class SendConferenceCallBroadcast extends Request, Api.TypeUpdates> { + call: Api.TypeInputGroupCall; + block: bytes; + } + export class InviteConferenceCallParticipant extends Request, Api.TypeUpdates> { + // flags: Api.Type; + video?: true; + call: Api.TypeInputGroupCall; + userId: Api.TypeInputUser; + } + export class DeclineConferenceCallInvite extends Request, Api.TypeUpdates> { + msgId: int; + } + export class GetGroupCallChainBlocks extends Request, Api.TypeUpdates> { + call: Api.TypeInputGroupCall; + subChainId: int; + offset: int; + limit: int; } } @@ -27228,7 +27489,7 @@ namespace Api { export namespace stories { export class CanSendStory extends Request, Bool> { + }>, stories.TypeCanSendStoryCount> { peer: Api.TypeInputPeer; } export class SendStory extends Request admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long = Chat; +channel#7482147e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull; channelFull#52d6806b flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int = ChatFull; @@ -158,9 +158,10 @@ messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_am messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction; messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction; messageActionStarGift#4717e8a4 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long = MessageAction; -messageActionStarGiftUnique#acdfcb81 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long = MessageAction; +messageActionStarGiftUnique#2e3ae60e flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_stars:flags.8?long can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction; messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction; messageActionPaidMessagesPrice#bcd71419 stars:long = MessageAction; +messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector = MessageAction; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; photoEmpty#2331b22d id:long = Photo; @@ -378,6 +379,7 @@ updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update; updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; updatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update; updateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update; +updateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks:Vector next_offset:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference; updates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference; @@ -750,6 +752,7 @@ phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason; phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason; phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason; phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason; +phoneCallDiscardReasonMigrateConferenceCall#9fbbf1f7 slug:string = PhoneCallDiscardReason; dataJSON#7d748d04 data:string = DataJSON; labeledPrice#cb296bf8 label:string amount:long = LabeledPrice; invoice#49ee584 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector terms_url:flags.10?string subscription_period:flags.11?int = Invoice; @@ -782,11 +785,11 @@ shippingOption#b6213cdf id:string title:string prices:Vector = Shi inputStickerSetItem#32da9e9c flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords keywords:flags.1?string = InputStickerSetItem; inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; phoneCallEmpty#5366c915 id:long = PhoneCall; -phoneCallWaiting#eed42858 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCallRequested#45361c63 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCallAccepted#22fd7181 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCall#3ba5940c flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int custom_parameters:flags.7?DataJSON conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCallDiscarded#f9d25503 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int conference_call:flags.8?InputGroupCall = PhoneCall; +phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; +phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCall#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true conference_supported:flags.8?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int custom_parameters:flags.7?DataJSON = PhoneCall; +phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; phoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; phoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection; phoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol; @@ -850,6 +853,7 @@ channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_ channelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction; channelAdminLogEventActionToggleSignatureProfiles#60a79c79 new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEventActionParticipantSubExtend#64642db3 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleAutotranslation#c517f77e new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults; channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true forums:flags.17?true sub_extend:flags.18?true = ChannelAdminLogEventsFilter; @@ -1020,7 +1024,7 @@ statsGraphError#bedc9822 error:string = StatsGraph; statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph; stats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector = stats.BroadcastStats; help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; -help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData; +help.promoData#8a4d87a flags:# proxy:flags.0?true expires:int peer:flags.3?Peer psa_type:flags.1?string psa_message:flags.2?string pending_suggestions:Vector dismissed_suggestions:Vector custom_pending_suggestion:flags.4?PendingSuggestion chats:Vector users:Vector = help.PromoData; videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize; videoSizeEmojiMarkup#f85c413c emoji_id:long background_colors:Vector = VideoSize; videoSizeStickerMarkup#da082fe stickerset:InputStickerSet sticker_id:long background_colors:Vector = VideoSize; @@ -1042,8 +1046,10 @@ messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:in peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; -groupCall#cdf8d3e3 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int conference_from_call:flags.14?long = GroupCall; +groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; +inputGroupCallSlug#fe06823f slug:string = InputGroupCall; +inputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall; groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant; phone.groupCall#9e727aad call:GroupCall participants:Vector participants_next_offset:string chats:Vector users:Vector = phone.GroupCall; phone.groupParticipants#f47751b6 count:int participants:Vector next_offset:string chats:Vector users:Vector version:int = phone.GroupParticipants; @@ -1134,6 +1140,7 @@ inputInvoiceStarGiftUpgrade#4d818d5d flags:# keep_original_details:flags.0?true inputInvoiceStarGiftTransfer#4a5f5bd9 stargift:InputSavedStarGift to_id:InputPeer = InputInvoice; inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int message:flags.0?TextWithEntities = InputInvoice; inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice; +inputInvoiceStarGiftResale#63cbc38c slug:string to_id:InputPeer = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; messages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = messages.TranscribedAudio; help.premiumPromo#5334759c status_text:string status_entities:Vector video_sections:Vector videos:Vector period_options:Vector users:Vector = help.PremiumPromo; @@ -1354,7 +1361,7 @@ starsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer; starsTransactionPeerAds#60682812 = StarsTransactionPeer; starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction; +starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; foundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory; stories.foundStories#e2de7737 flags:# count:int stories:Vector next_offset:flags.0?string chats:Vector users:Vector = stories.FoundStories; @@ -1373,8 +1380,8 @@ starsSubscription#2e6eab1a flags:# canceled:flags.0?true can_refulfill:flags.1?t messageReactor#4ba3a95a flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer count:int = MessageReactor; starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true stars:long yearly_boosts:int store_product:flags.2?string currency:string amount:long winners:Vector = StarsGiveawayOption; starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; -starGift#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift; -starGiftUnique#5c62d151 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string = StarGift; +starGift#c62aca28 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string = StarGift; +starGiftUnique#6411db89 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#901689ea hash:int gifts:Vector = payments.StarGifts; messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption; @@ -1395,17 +1402,18 @@ botVerifierSettings#b0cd6617 flags:# can_modify_custom_description:flags.1?true botVerification#f93cd45c bot_id:long icon:long description:string = BotVerification; starGiftAttributeModel#39d99013 name:string document:Document rarity_permille:int = StarGiftAttribute; starGiftAttributePattern#13acff19 name:string document:Document rarity_permille:int = StarGiftAttribute; -starGiftAttributeBackdrop#94271762 name:string center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; +starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute; payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector = payments.StarGiftUpgradePreview; users.users#62d706b8 users:Vector = users.Users; users.usersSlice#315a4974 count:int users:Vector = users.Users; payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector = payments.UniqueStarGift; messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector = messages.WebPagePreview; -savedStarGift#6056dba5 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long = SavedStarGift; +savedStarGift#dfda0499 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int = SavedStarGift; payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector next_offset:flags.0?string chats:Vector users:Vector = payments.SavedStarGifts; inputSavedStarGiftUser#69279795 msg_id:int = InputSavedStarGift; inputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGift; +inputSavedStarGiftSlug#2085c238 slug:string = InputSavedStarGift; payments.starGiftWithdrawalUrl#84aa3a9c url:string = payments.StarGiftWithdrawalUrl; paidReactionPrivacyDefault#206ad49e = PaidReactionPrivacy; paidReactionPrivacyAnonymous#1f0c1ad9 = PaidReactionPrivacy; @@ -1419,6 +1427,13 @@ disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?tr sponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?string additional_info:flags.1?string = SponsoredPeer; contacts.sponsoredPeersEmpty#ea32b4b1 = contacts.SponsoredPeers; contacts.sponsoredPeers#eb032884 peers:Vector chats:Vector users:Vector = contacts.SponsoredPeers; +starGiftAttributeIdModel#48aaae3c document_id:long = StarGiftAttributeId; +starGiftAttributeIdPattern#4a162433 document_id:long = StarGiftAttributeId; +starGiftAttributeIdBackdrop#1f01c757 backdrop_id:int = StarGiftAttributeId; +starGiftAttributeCounter#2eb1b658 attribute:StarGiftAttributeId count:int = StarGiftAttributeCounter; +payments.resaleStarGifts#947a12df flags:# count:int gifts:Vector next_offset:flags.0?string attributes:flags.1?Vector attributes_hash:flags.1?long chats:Vector counters:flags.2?Vector users:Vector = payments.ResaleStarGifts; +stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount; +pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion; ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X; @@ -1750,7 +1765,8 @@ payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift; payments.getSavedStarGifts#23830de9 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_limited:flags.3?true exclude_unique:flags.4?true sort_by_value:flags.5?true peer:InputPeer offset:string limit:int = payments.SavedStarGifts; payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl; payments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector = Bool; -phone.requestCall#a6c4600c flags:# video:flags.0?true user_id:InputUser conference_call:flags.1?InputGroupCall random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; +payments.updateStarGiftPrice#3baea4e1 stargift:InputSavedStarGift resell_stars:long = Updates; +phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall; phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool; @@ -1759,7 +1775,7 @@ phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhon phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool; phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool; phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates; -phone.joinGroupCall#d61e1df3 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string key_fingerprint:flags.3?long params:DataJSON = Updates; +phone.joinGroupCall#8fb53057 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string public_key:flags.3?int256 block:flags.3?bytes params:DataJSON = Updates; phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates; phone.discardGroupCall#7a777135 call:InputGroupCall = Updates; phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall; diff --git a/src/lib/gramjs/tl/static/api.json b/src/lib/gramjs/tl/static/api.json index 1095184d1..5d9f58f71 100644 --- a/src/lib/gramjs/tl/static/api.json +++ b/src/lib/gramjs/tl/static/api.json @@ -319,6 +319,7 @@ "payments.getUniqueStarGift", "payments.getStarGiftWithdrawalUrl", "payments.toggleStarGiftsPinnedToTop", + "payments.updateStarGiftPrice", "langpack.getLangPack", "langpack.getStrings", "langpack.getLanguages", diff --git a/src/lib/gramjs/tl/static/api.tl b/src/lib/gramjs/tl/static/api.tl index 1a84527ac..ecc6ded63 100644 --- a/src/lib/gramjs/tl/static/api.tl +++ b/src/lib/gramjs/tl/static/api.tl @@ -99,7 +99,7 @@ userStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus; chatEmpty#29562865 id:long = Chat; chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; chatForbidden#6592a1a7 id:long title:string = Chat; -channel#7482147e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long = Chat; +channel#7482147e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull; @@ -184,9 +184,10 @@ messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_am messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction; messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction; messageActionStarGift#4717e8a4 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long = MessageAction; -messageActionStarGiftUnique#acdfcb81 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long = MessageAction; +messageActionStarGiftUnique#2e3ae60e flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_stars:flags.8?long can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction; messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction; messageActionPaidMessagesPrice#bcd71419 stars:long = MessageAction; +messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector = MessageAction; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; @@ -431,6 +432,7 @@ updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update; updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; updatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update; updateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update; +updateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks:Vector next_offset:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -901,6 +903,7 @@ phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason; phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason; phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason; phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason; +phoneCallDiscardReasonMigrateConferenceCall#9fbbf1f7 slug:string = PhoneCallDiscardReason; dataJSON#7d748d04 data:string = DataJSON; @@ -955,11 +958,11 @@ inputStickerSetItem#32da9e9c flags:# document:InputDocument emoji:string mask_co inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; phoneCallEmpty#5366c915 id:long = PhoneCall; -phoneCallWaiting#eed42858 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCallRequested#45361c63 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCallAccepted#22fd7181 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCall#3ba5940c flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int custom_parameters:flags.7?DataJSON conference_call:flags.8?InputGroupCall = PhoneCall; -phoneCallDiscarded#f9d25503 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int conference_call:flags.8?InputGroupCall = PhoneCall; +phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; +phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCall#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true conference_supported:flags.8?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int custom_parameters:flags.7?DataJSON = PhoneCall; +phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; phoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; phoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection; @@ -1033,6 +1036,7 @@ channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_ channelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction; channelAdminLogEventActionToggleSignatureProfiles#60a79c79 new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEventActionParticipantSubExtend#64642db3 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleAutotranslation#c517f77e new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; @@ -1300,7 +1304,7 @@ statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph stats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector = stats.BroadcastStats; help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; -help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData; +help.promoData#8a4d87a flags:# proxy:flags.0?true expires:int peer:flags.3?Peer psa_type:flags.1?string psa_message:flags.2?string pending_suggestions:Vector dismissed_suggestions:Vector custom_pending_suggestion:flags.4?PendingSuggestion chats:Vector users:Vector = help.PromoData; videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize; videoSizeEmojiMarkup#f85c413c emoji_id:long background_colors:Vector = VideoSize; @@ -1339,9 +1343,11 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; -groupCall#cdf8d3e3 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int conference_from_call:flags.14?long = GroupCall; +groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; +inputGroupCallSlug#fe06823f slug:string = InputGroupCall; +inputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall; groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant; @@ -1485,6 +1491,7 @@ inputInvoiceStarGiftUpgrade#4d818d5d flags:# keep_original_details:flags.0?true inputInvoiceStarGiftTransfer#4a5f5bd9 stargift:InputSavedStarGift to_id:InputPeer = InputInvoice; inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int message:flags.0?TextWithEntities = InputInvoice; inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice; +inputInvoiceStarGiftResale#63cbc38c slug:string to_id:InputPeer = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; @@ -1844,7 +1851,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction; +starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; @@ -1882,8 +1889,8 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; -starGift#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift; -starGiftUnique#5c62d151 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string = StarGift; +starGift#c62aca28 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string = StarGift; +starGiftUnique#6411db89 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#901689ea hash:int gifts:Vector = payments.StarGifts; @@ -1919,7 +1926,7 @@ botVerification#f93cd45c bot_id:long icon:long description:string = BotVerificat starGiftAttributeModel#39d99013 name:string document:Document rarity_permille:int = StarGiftAttribute; starGiftAttributePattern#13acff19 name:string document:Document rarity_permille:int = StarGiftAttribute; -starGiftAttributeBackdrop#94271762 name:string center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; +starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute; payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector = payments.StarGiftUpgradePreview; @@ -1931,12 +1938,13 @@ payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector = payments.Uni messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector = messages.WebPagePreview; -savedStarGift#6056dba5 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long = SavedStarGift; +savedStarGift#dfda0499 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int = SavedStarGift; payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector next_offset:flags.0?string chats:Vector users:Vector = payments.SavedStarGifts; inputSavedStarGiftUser#69279795 msg_id:int = InputSavedStarGift; inputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGift; +inputSavedStarGiftSlug#2085c238 slug:string = InputSavedStarGift; payments.starGiftWithdrawalUrl#84aa3a9c url:string = payments.StarGiftWithdrawalUrl; @@ -1959,6 +1967,18 @@ sponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?st contacts.sponsoredPeersEmpty#ea32b4b1 = contacts.SponsoredPeers; contacts.sponsoredPeers#eb032884 peers:Vector chats:Vector users:Vector = contacts.SponsoredPeers; +starGiftAttributeIdModel#48aaae3c document_id:long = StarGiftAttributeId; +starGiftAttributeIdPattern#4a162433 document_id:long = StarGiftAttributeId; +starGiftAttributeIdBackdrop#1f01c757 backdrop_id:int = StarGiftAttributeId; + +starGiftAttributeCounter#2eb1b658 attribute:StarGiftAttributeId count:int = StarGiftAttributeCounter; + +payments.resaleStarGifts#947a12df flags:# count:int gifts:Vector next_offset:flags.0?string attributes:flags.1?Vector attributes_hash:flags.1?long chats:Vector counters:flags.2?Vector users:Vector = payments.ResaleStarGifts; + +stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount; + +pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2479,6 +2499,7 @@ channels.setEmojiStickers#3cd930b7 channel:InputChannel stickerset:InputStickerS channels.restrictSponsoredMessages#9ae91519 channel:InputChannel restricted:Bool = Updates; channels.searchPosts#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; channels.updatePaidMessagesPrice#fc84653f channel:InputChannel send_paid_messages_stars:long = Updates; +channels.toggleAutotranslation#167fc0a1 channel:InputChannel enabled:Bool = Updates; bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON; bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool; @@ -2559,6 +2580,8 @@ payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password: payments.toggleChatStarGiftNotifications#60eaefa1 flags:# enabled:flags.0?true peer:InputPeer = Bool; payments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector = Bool; payments.canPurchaseStore#4fdc5ea7 purpose:InputStorePaymentPurpose = Bool; +payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector offset:string limit:int = payments.ResaleStarGifts; +payments.updateStarGiftPrice#3baea4e1 stargift:InputSavedStarGift resell_stars:long = Updates; stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; @@ -2573,7 +2596,7 @@ stickers.deleteStickerSet#87704394 stickerset:InputStickerSet = Bool; stickers.replaceSticker#4696459a sticker:InputDocument new_sticker:InputStickerSetItem = messages.StickerSet; phone.getCallConfig#55451fa9 = DataJSON; -phone.requestCall#a6c4600c flags:# video:flags.0?true user_id:InputUser conference_call:flags.1?InputGroupCall random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; +phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall; phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool; @@ -2582,7 +2605,7 @@ phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhon phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool; phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool; phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates; -phone.joinGroupCall#d61e1df3 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string key_fingerprint:flags.3?long params:DataJSON = Updates; +phone.joinGroupCall#8fb53057 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string public_key:flags.3?int256 block:flags.3?bytes params:DataJSON = Updates; phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates; phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector = Updates; phone.discardGroupCall#7a777135 call:InputGroupCall = Updates; @@ -2603,7 +2626,12 @@ phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates; phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels; phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl; phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool; -phone.createConferenceCall#dfc909ab peer:InputPhoneCall key_fingerprint:long = phone.PhoneCall; +phone.createConferenceCall#7d0444bb flags:# muted:flags.0?true video_stopped:flags.2?true join:flags.3?true random_id:int public_key:flags.3?int256 block:flags.3?bytes params:flags.3?DataJSON = Updates; +phone.deleteConferenceCallParticipants#8ca60525 flags:# only_left:flags.0?true kick:flags.1?true call:InputGroupCall ids:Vector block:bytes = Updates; +phone.sendConferenceCallBroadcast#c6701900 call:InputGroupCall block:bytes = Updates; +phone.inviteConferenceCallParticipant#bcf22685 flags:# video:flags.0?true call:InputGroupCall user_id:InputUser = Updates; +phone.declineConferenceCallInvite#3c479971 msg_id:int = Updates; +phone.getGroupCallChainBlocks#ee9f88a6 call:InputGroupCall sub_chain_id:int offset:int limit:int = Updates; langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector; @@ -2636,7 +2664,7 @@ chatlists.hideChatlistUpdates#66e486fb chatlist:InputChatlist = Bool; chatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector; chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector = Updates; -stories.canSendStory#c7dfdfdd peer:InputPeer = Bool; +stories.canSendStory#30eb63f0 peer:InputPeer = stories.CanSendStoryCount; stories.sendStory#e4e6694b flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector caption:flags.0?string entities:flags.1?Vector privacy_rules:Vector random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int = Updates; stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector caption:flags.1?string entities:flags.1?Vector privacy_rules:flags.2?Vector = Updates; stories.deleteStories#ae59db5f peer:InputPeer id:Vector = Vector; diff --git a/src/styles/icons.scss b/src/styles/icons.scss index 64149d8ae..1c6489d46 100644 --- a/src/styles/icons.scss +++ b/src/styles/icons.scss @@ -94,202 +94,208 @@ $icons-map: ( "comments": "\f139", "copy-media": "\f13a", "copy": "\f13b", - "crown-take-off": "\f13c", - "crown-wear": "\f13d", - "darkmode": "\f13e", - "data": "\f13f", - "delete-filled": "\f140", - "delete-left": "\f141", - "delete-user": "\f142", - "delete": "\f143", - "diamond": "\f144", - "document": "\f145", - "double-badge": "\f146", - "down": "\f147", - "download": "\f148", - "eats": "\f149", - "edit": "\f14a", - "email": "\f14b", - "enter": "\f14c", - "expand-modal": "\f14d", - "expand": "\f14e", - "eye-crossed-outline": "\f14f", - "eye-crossed": "\f150", - "eye-outline": "\f151", - "eye": "\f152", - "favorite-filled": "\f153", - "favorite": "\f154", - "file-badge": "\f155", - "flag": "\f156", - "folder-badge": "\f157", - "folder": "\f158", - "fontsize": "\f159", - "forums": "\f15a", - "forward": "\f15b", - "fragment": "\f15c", - "frozen-time": "\f15d", - "fullscreen": "\f15e", - "gifs": "\f15f", - "gift": "\f160", - "group-filled": "\f161", - "group": "\f162", - "grouped-disable": "\f163", - "grouped": "\f164", - "hand-stop": "\f165", - "hashtag": "\f166", - "heart-outline": "\f167", - "heart": "\f168", - "help": "\f169", - "info-filled": "\f16a", - "info": "\f16b", - "install": "\f16c", - "italic": "\f16d", - "key": "\f16e", - "keyboard": "\f16f", - "lamp": "\f170", - "language": "\f171", - "large-pause": "\f172", - "large-play": "\f173", - "link-badge": "\f174", - "link-broken": "\f175", - "link": "\f176", - "location": "\f177", - "lock-badge": "\f178", - "lock": "\f179", - "logout": "\f17a", - "loop": "\f17b", - "mention": "\f17c", - "message-failed": "\f17d", - "message-pending": "\f17e", - "message-read": "\f17f", - "message-succeeded": "\f180", - "message": "\f181", - "microphone-alt": "\f182", - "microphone": "\f183", - "monospace": "\f184", - "more-circle": "\f185", - "more": "\f186", - "move-caption-down": "\f187", - "move-caption-up": "\f188", - "mute": "\f189", - "muted": "\f18a", - "my-notes": "\f18b", - "new-chat-filled": "\f18c", - "next": "\f18d", - "nochannel": "\f18e", - "noise-suppression": "\f18f", - "non-contacts": "\f190", - "one-filled": "\f191", - "open-in-new-tab": "\f192", - "password-off": "\f193", - "pause": "\f194", - "permissions": "\f195", - "phone-discard-outline": "\f196", - "phone-discard": "\f197", - "phone": "\f198", - "photo": "\f199", - "pin-badge": "\f19a", - "pin-list": "\f19b", - "pin": "\f19c", - "pinned-chat": "\f19d", - "pinned-message": "\f19e", - "pip": "\f19f", - "play-story": "\f1a0", - "play": "\f1a1", - "poll": "\f1a2", - "previous": "\f1a3", - "privacy-policy": "\f1a4", - "proof-of-ownership": "\f1a5", - "quote-text": "\f1a6", - "quote": "\f1a7", - "radial-badge": "\f1a8", - "readchats": "\f1a9", - "recent": "\f1aa", - "reload": "\f1ab", - "remove-quote": "\f1ac", - "remove": "\f1ad", - "reopen-topic": "\f1ae", - "replace": "\f1af", - "replies": "\f1b0", - "reply-filled": "\f1b1", - "reply": "\f1b2", - "revenue-split": "\f1b3", - "revote": "\f1b4", - "save-story": "\f1b5", - "saved-messages": "\f1b6", - "schedule": "\f1b7", - "search": "\f1b8", - "select": "\f1b9", - "send-outline": "\f1ba", - "send": "\f1bb", - "settings-filled": "\f1bc", - "settings": "\f1bd", - "share-filled": "\f1be", - "share-screen-outlined": "\f1bf", - "share-screen-stop": "\f1c0", - "share-screen": "\f1c1", - "show-message": "\f1c2", - "sidebar": "\f1c3", - "skip-next": "\f1c4", - "skip-previous": "\f1c5", - "smallscreen": "\f1c6", - "smile": "\f1c7", - "sort": "\f1c8", - "speaker-muted-story": "\f1c9", - "speaker-outline": "\f1ca", - "speaker-story": "\f1cb", - "speaker": "\f1cc", - "spoiler-disable": "\f1cd", - "spoiler": "\f1ce", - "sport": "\f1cf", - "star": "\f1d0", - "stars-lock": "\f1d1", - "stats": "\f1d2", - "stealth-future": "\f1d3", - "stealth-past": "\f1d4", - "stickers": "\f1d5", - "stop-raising-hand": "\f1d6", - "stop": "\f1d7", - "story-caption": "\f1d8", - "story-expired": "\f1d9", - "story-priority": "\f1da", - "story-reply": "\f1db", - "strikethrough": "\f1dc", - "tag-add": "\f1dd", - "tag-crossed": "\f1de", - "tag-filter": "\f1df", - "tag-name": "\f1e0", - "tag": "\f1e1", - "timer": "\f1e2", - "toncoin": "\f1e3", - "trade": "\f1e4", - "transcribe": "\f1e5", - "truck": "\f1e6", - "unarchive": "\f1e7", - "underlined": "\f1e8", - "unique-profile": "\f1e9", - "unlock-badge": "\f1ea", - "unlock": "\f1eb", - "unmute": "\f1ec", - "unpin": "\f1ed", - "unread": "\f1ee", - "up": "\f1ef", - "user-filled": "\f1f0", - "user-online": "\f1f1", - "user": "\f1f2", - "video-outlined": "\f1f3", - "video-stop": "\f1f4", - "video": "\f1f5", - "view-once": "\f1f6", - "voice-chat": "\f1f7", - "volume-1": "\f1f8", - "volume-2": "\f1f9", - "volume-3": "\f1fa", - "web": "\f1fb", - "webapp": "\f1fc", - "word-wrap": "\f1fd", - "zoom-in": "\f1fe", - "zoom-out": "\f1ff", + "crown-take-off-outline": "\f13c", + "crown-take-off": "\f13d", + "crown-wear-outline": "\f13e", + "crown-wear": "\f13f", + "darkmode": "\f140", + "data": "\f141", + "delete-filled": "\f142", + "delete-left": "\f143", + "delete-user": "\f144", + "delete": "\f145", + "diamond": "\f146", + "document": "\f147", + "double-badge": "\f148", + "down": "\f149", + "download": "\f14a", + "eats": "\f14b", + "edit": "\f14c", + "email": "\f14d", + "enter": "\f14e", + "expand-modal": "\f14f", + "expand": "\f150", + "eye-crossed-outline": "\f151", + "eye-crossed": "\f152", + "eye-outline": "\f153", + "eye": "\f154", + "favorite-filled": "\f155", + "favorite": "\f156", + "file-badge": "\f157", + "flag": "\f158", + "folder-badge": "\f159", + "folder": "\f15a", + "fontsize": "\f15b", + "forums": "\f15c", + "forward": "\f15d", + "fragment": "\f15e", + "frozen-time": "\f15f", + "fullscreen": "\f160", + "gifs": "\f161", + "gift": "\f162", + "group-filled": "\f163", + "group": "\f164", + "grouped-disable": "\f165", + "grouped": "\f166", + "hand-stop": "\f167", + "hashtag": "\f168", + "heart-outline": "\f169", + "heart": "\f16a", + "help": "\f16b", + "info-filled": "\f16c", + "info": "\f16d", + "install": "\f16e", + "italic": "\f16f", + "key": "\f170", + "keyboard": "\f171", + "lamp": "\f172", + "language": "\f173", + "large-pause": "\f174", + "large-play": "\f175", + "link-badge": "\f176", + "link-broken": "\f177", + "link": "\f178", + "location": "\f179", + "lock-badge": "\f17a", + "lock": "\f17b", + "logout": "\f17c", + "loop": "\f17d", + "mention": "\f17e", + "message-failed": "\f17f", + "message-pending": "\f180", + "message-read": "\f181", + "message-succeeded": "\f182", + "message": "\f183", + "microphone-alt": "\f184", + "microphone": "\f185", + "monospace": "\f186", + "more-circle": "\f187", + "more": "\f188", + "move-caption-down": "\f189", + "move-caption-up": "\f18a", + "mute": "\f18b", + "muted": "\f18c", + "my-notes": "\f18d", + "new-chat-filled": "\f18e", + "next": "\f18f", + "nochannel": "\f190", + "noise-suppression": "\f191", + "non-contacts": "\f192", + "one-filled": "\f193", + "open-in-new-tab": "\f194", + "password-off": "\f195", + "pause": "\f196", + "permissions": "\f197", + "phone-discard-outline": "\f198", + "phone-discard": "\f199", + "phone": "\f19a", + "photo": "\f19b", + "pin-badge": "\f19c", + "pin-list": "\f19d", + "pin": "\f19e", + "pinned-chat": "\f19f", + "pinned-message": "\f1a0", + "pip": "\f1a1", + "play-story": "\f1a2", + "play": "\f1a3", + "poll": "\f1a4", + "previous": "\f1a5", + "privacy-policy": "\f1a6", + "proof-of-ownership": "\f1a7", + "quote-text": "\f1a8", + "quote": "\f1a9", + "radial-badge": "\f1aa", + "readchats": "\f1ab", + "recent": "\f1ac", + "reload": "\f1ad", + "remove-quote": "\f1ae", + "remove": "\f1af", + "reopen-topic": "\f1b0", + "replace": "\f1b1", + "replies": "\f1b2", + "reply-filled": "\f1b3", + "reply": "\f1b4", + "revenue-split": "\f1b5", + "revote": "\f1b6", + "save-story": "\f1b7", + "saved-messages": "\f1b8", + "schedule": "\f1b9", + "search": "\f1ba", + "select": "\f1bb", + "sell-outline": "\f1bc", + "sell": "\f1bd", + "send-outline": "\f1be", + "send": "\f1bf", + "settings-filled": "\f1c0", + "settings": "\f1c1", + "share-filled": "\f1c2", + "share-screen-outlined": "\f1c3", + "share-screen-stop": "\f1c4", + "share-screen": "\f1c5", + "show-message": "\f1c6", + "sidebar": "\f1c7", + "skip-next": "\f1c8", + "skip-previous": "\f1c9", + "smallscreen": "\f1ca", + "smile": "\f1cb", + "sort": "\f1cc", + "speaker-muted-story": "\f1cd", + "speaker-outline": "\f1ce", + "speaker-story": "\f1cf", + "speaker": "\f1d0", + "spoiler-disable": "\f1d1", + "spoiler": "\f1d2", + "sport": "\f1d3", + "star": "\f1d4", + "stars-lock": "\f1d5", + "stats": "\f1d6", + "stealth-future": "\f1d7", + "stealth-past": "\f1d8", + "stickers": "\f1d9", + "stop-raising-hand": "\f1da", + "stop": "\f1db", + "story-caption": "\f1dc", + "story-expired": "\f1dd", + "story-priority": "\f1de", + "story-reply": "\f1df", + "strikethrough": "\f1e0", + "tag-add": "\f1e1", + "tag-crossed": "\f1e2", + "tag-filter": "\f1e3", + "tag-name": "\f1e4", + "tag": "\f1e5", + "timer": "\f1e6", + "toncoin": "\f1e7", + "trade": "\f1e8", + "transcribe": "\f1e9", + "truck": "\f1ea", + "unarchive": "\f1eb", + "underlined": "\f1ec", + "unique-profile": "\f1ed", + "unlist-outline": "\f1ee", + "unlist": "\f1ef", + "unlock-badge": "\f1f0", + "unlock": "\f1f1", + "unmute": "\f1f2", + "unpin": "\f1f3", + "unread": "\f1f4", + "up": "\f1f5", + "user-filled": "\f1f6", + "user-online": "\f1f7", + "user": "\f1f8", + "video-outlined": "\f1f9", + "video-stop": "\f1fa", + "video": "\f1fb", + "view-once": "\f1fc", + "voice-chat": "\f1fd", + "volume-1": "\f1fe", + "volume-2": "\f1ff", + "volume-3": "\f200", + "web": "\f201", + "webapp": "\f202", + "word-wrap": "\f203", + "zoom-in": "\f204", + "zoom-out": "\f205", ); .icon-active-sessions::before { @@ -469,9 +475,15 @@ $icons-map: ( .icon-copy::before { content: map.get($icons-map, "copy"); } +.icon-crown-take-off-outline::before { + content: map.get($icons-map, "crown-take-off-outline"); +} .icon-crown-take-off::before { content: map.get($icons-map, "crown-take-off"); } +.icon-crown-wear-outline::before { + content: map.get($icons-map, "crown-wear-outline"); +} .icon-crown-wear::before { content: map.get($icons-map, "crown-wear"); } @@ -847,6 +859,12 @@ $icons-map: ( .icon-select::before { content: map.get($icons-map, "select"); } +.icon-sell-outline::before { + content: map.get($icons-map, "sell-outline"); +} +.icon-sell::before { + content: map.get($icons-map, "sell"); +} .icon-send-outline::before { content: map.get($icons-map, "send-outline"); } @@ -991,6 +1009,12 @@ $icons-map: ( .icon-unique-profile::before { content: map.get($icons-map, "unique-profile"); } +.icon-unlist-outline::before { + content: map.get($icons-map, "unlist-outline"); +} +.icon-unlist::before { + content: map.get($icons-map, "unlist"); +} .icon-unlock-badge::before { content: map.get($icons-map, "unlock-badge"); } diff --git a/src/styles/icons.woff b/src/styles/icons.woff index 0d8834730..c92f0ac3f 100644 Binary files a/src/styles/icons.woff and b/src/styles/icons.woff differ diff --git a/src/styles/icons.woff2 b/src/styles/icons.woff2 index 74d3ffb3c..ff82ee93f 100644 Binary files a/src/styles/icons.woff2 and b/src/styles/icons.woff2 differ diff --git a/src/types/icons/font.ts b/src/types/icons/font.ts index ee634a4da..4cb9156ce 100644 --- a/src/types/icons/font.ts +++ b/src/types/icons/font.ts @@ -58,7 +58,9 @@ export type FontIconName = | 'comments' | 'copy-media' | 'copy' + | 'crown-take-off-outline' | 'crown-take-off' + | 'crown-wear-outline' | 'crown-wear' | 'darkmode' | 'data' @@ -184,6 +186,8 @@ export type FontIconName = | 'schedule' | 'search' | 'select' + | 'sell-outline' + | 'sell' | 'send-outline' | 'send' | 'settings-filled' @@ -232,6 +236,8 @@ export type FontIconName = | 'unarchive' | 'underlined' | 'unique-profile' + | 'unlist-outline' + | 'unlist' | 'unlock-badge' | 'unlock' | 'unmute' diff --git a/src/types/language.d.ts b/src/types/language.d.ts index 744289f32..997bd45ed 100644 --- a/src/types/language.d.ts +++ b/src/types/language.d.ts @@ -1235,6 +1235,7 @@ export interface LangPair { 'GiftInfoWear': undefined; 'GiftInfoTakeOff': undefined; 'GiftInfoTransfer': undefined; + 'GiftInfoUnlist': undefined; 'GiftTransferTitle': undefined; 'GiftTransferTON': undefined; 'GiftTransferConfirmButtonFree': undefined; @@ -1502,6 +1503,13 @@ export interface LangPair { 'ActionPaidMessageGroupPriceFree': undefined; 'NotificationTitleNotSupportedInFrozenAccount': undefined; 'NotificationMessageNotSupportedInFrozenAccount': undefined; + 'GiftRibbonSale': undefined; + 'StarsGiftBought': undefined; + 'GiftSellTitle': undefined; + 'Sell': undefined; + 'InputPlaceholderGiftResalePrice': undefined; + 'StarGiftSaleTransaction': undefined; + 'StarGiftPurchaseTransaction': undefined; 'ContextMenuItemMention': undefined; } @@ -2411,6 +2419,48 @@ export interface LangPairWithVariables { 'user': V; 'stars': V; }; + 'NotificationGiftIsSale': { + 'gift': V; + }; + 'NotificationGiftIsUnlist': { + 'gift': V; + }; + 'ButtonBuyGift': { + 'stars': V; + }; + 'GiftInfoBuyGift': { + 'user': V; + }; + 'ButtonSellGift': { + 'stars': V; + }; + 'DescriptionComposerGiftResalePrice': { + 'stars': V; + }; + 'DescriptionComposerGiftMinimumPrice': { + 'stars': V; + }; + 'ApiMessageMessageActionResaleStarGiftUniqueOutgoing': { + 'stars': V; + 'gift': V; + }; + 'ApiMessageMessageActionResaleStarGiftUniqueIncoming': { + 'stars': V; + 'gift': V; + }; + 'ModalStarsBalanceBarDescription': { + 'stars': V; + }; + 'NotificationGiftCanResellAt': { + 'date': V; + }; + 'NotificationGiftCanTransferAt': { + 'date': V; + }; + 'GiftBuyConfirmDescription': { + 'gift': V; + 'stars': V; + }; 'ComposerTitleForwardFrom': { 'users': V; }; diff --git a/src/util/localization/format.tsx b/src/util/localization/format.tsx index 3c62ebe3d..d0a33b2d3 100644 --- a/src/util/localization/format.tsx +++ b/src/util/localization/format.tsx @@ -12,7 +12,7 @@ export function formatStarsAsText(lang: LangFn, amount: number) { return lang('StarsAmountText', { amount }, { pluralValue: amount }); } -export function formatStarsAsIcon(lang: LangFn, amount: number, options?: { +export function formatStarsAsIcon(lang: LangFn, amount: number | string, options?: { asFont?: boolean; className?: string; containerClassName?: string; }) { const { asFont, className, containerClassName } = options || {}; const icon = asFont