mirror of
https://github.com/zhigang1992/mtcute.git
synced 2026-01-12 17:32:35 +08:00
feat(tl): updated to layer 199
This commit is contained in:
@@ -2,6 +2,7 @@ import type { ITelegramClient } from '../../client.types.js'
|
||||
|
||||
import type {
|
||||
InputMessageId,
|
||||
InputPeerLike,
|
||||
} from '../../types/index.js'
|
||||
import { tl } from '@mtcute/tl'
|
||||
import { MtcuteError } from '../../../types/errors.js'
|
||||
@@ -27,9 +28,16 @@ import { resolvePeer } from '../users/resolve-peer.js'
|
||||
export async function sendPaidReaction(
|
||||
client: ITelegramClient,
|
||||
params: InputMessageId & {
|
||||
/** Whether to send the reaction anonymously */
|
||||
/**
|
||||
* Whether to send the reaction anonymously
|
||||
*/
|
||||
anonymous?: boolean
|
||||
|
||||
/**
|
||||
* Peer as which to send the reaction, mutually exclusive with `anonymous`
|
||||
*/
|
||||
asPeer?: InputPeerLike
|
||||
|
||||
/**
|
||||
* Number of reactions to send
|
||||
*
|
||||
@@ -44,11 +52,18 @@ export async function sendPaidReaction(
|
||||
shouldDispatch?: true
|
||||
},
|
||||
): Promise<MessageReactions> {
|
||||
const { anonymous, count = 1 } = params
|
||||
const { anonymous, asPeer, count = 1 } = params
|
||||
const { chatId, message } = normalizeInputMessageId(params)
|
||||
|
||||
const peer = await resolvePeer(client, chatId)
|
||||
|
||||
let privacy: tl.TypePaidReactionPrivacy | undefined
|
||||
if (anonymous !== undefined) {
|
||||
privacy = { _: anonymous ? 'paidReactionPrivacyAnonymous' : 'paidReactionPrivacyDefault' }
|
||||
} else if (asPeer) {
|
||||
privacy = { _: 'paidReactionPrivacyPeer', peer: await resolvePeer(client, asPeer) }
|
||||
}
|
||||
|
||||
let res
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
@@ -58,7 +73,7 @@ export async function sendPaidReaction(
|
||||
peer,
|
||||
msgId: message,
|
||||
count,
|
||||
private: anonymous,
|
||||
private: privacy,
|
||||
randomId: await client.getMtprotoMessageId(),
|
||||
})
|
||||
break
|
||||
|
||||
@@ -189,6 +189,11 @@ export class StarGiftUnique {
|
||||
get ownerAddress(): string | null {
|
||||
return this.raw.ownerAddress ?? null
|
||||
}
|
||||
|
||||
/** TON address of the gift NFT */
|
||||
get giftAddress(): string | null {
|
||||
return this.raw.giftAddress ?? null
|
||||
}
|
||||
}
|
||||
|
||||
makeInspectable(StarGiftUnique)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
TL schema and related utils used for mtcute.
|
||||
|
||||
Generated from TL layer **198** (last updated on 25.01.2025).
|
||||
Generated from TL layer **199** (last updated on 12.02.2025).
|
||||
|
||||
## About
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,3 +5,5 @@ messageMediaDocument_layer197#dd570bd5 flags:# nopremium:flags.3?true spoiler:fl
|
||||
channelFull_layer197#9ff3b858 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 id:int53 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<BotInfo> 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?int53 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<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<int53> 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 = ChatFull;
|
||||
messageActionStarGiftUnique_layer197#26077b99 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 = MessageAction;
|
||||
messageActionStarGift_layer197#d8f4f0a7 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 = MessageAction;
|
||||
// LAYER 198
|
||||
starGiftUnique_layer198#f2fe7e4a 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<StarGiftAttribute> availability_issued:int availability_total:int = StarGift;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mtcute/tl",
|
||||
"version": "198.0.0",
|
||||
"version": "199.0.0",
|
||||
"description": "TL schema used for mtcute",
|
||||
"author": "alina sireneva <alina@tei.su>",
|
||||
"license": "MIT",
|
||||
|
||||
Reference in New Issue
Block a user