Compare commits
No commits in common. "6e4661acd1a9c740806cf25c9bd2ddcafbb250a5" and "016a6dce3fd07f6a409a45907bb12186ce3e8591" have entirely different histories.
6e4661acd1
...
016a6dce3f
14 changed files with 8 additions and 86 deletions
|
@ -35,7 +35,6 @@ export default ({ mode }) => defineConfig({
|
||||||
// https://vitepress.dev/reference/default-theme-config
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
nav: [
|
nav: [
|
||||||
{ text: 'Guide', link: '/guide/' },
|
{ text: 'Guide', link: '/guide/' },
|
||||||
{ text: 'Playground', link: '//play.mtcute.dev' },
|
|
||||||
{ text: 'Reference', link: '//ref.mtcute.dev' },
|
{ text: 'Reference', link: '//ref.mtcute.dev' },
|
||||||
],
|
],
|
||||||
socialLinks: [
|
socialLinks: [
|
||||||
|
|
|
@ -11,9 +11,6 @@ hero:
|
||||||
- theme: brand
|
- theme: brand
|
||||||
text: Quick Start →
|
text: Quick Start →
|
||||||
link: /guide/
|
link: /guide/
|
||||||
- theme: alt
|
|
||||||
text: 📝 Try online
|
|
||||||
link: //play.mtcute.dev
|
|
||||||
- theme: alt
|
- theme: alt
|
||||||
text: API Reference
|
text: API Reference
|
||||||
link: //ref.mtcute.dev
|
link: //ref.mtcute.dev
|
||||||
|
|
|
@ -24,7 +24,7 @@ import type { QuoteParamsFrom } from './methods/messages/send-quote.js'
|
||||||
import type { CanApplyBoostResult } from './methods/premium/can-apply-boost.js'
|
import type { CanApplyBoostResult } from './methods/premium/can-apply-boost.js'
|
||||||
import type { CanSendStoryResult } from './methods/stories/can-send-story.js'
|
import type { CanSendStoryResult } from './methods/stories/can-send-story.js'
|
||||||
import type { ITelegramStorageProvider } from './storage/provider.js'
|
import type { ITelegramStorageProvider } from './storage/provider.js'
|
||||||
import type { AllStories, ArrayPaginated, ArrayWithTotal, Boost, BoostSlot, BoostStats, BotChatJoinRequestUpdate, BotCommands, BotReactionCountUpdate, BotReactionUpdate, BotStoppedUpdate, BusinessCallbackQuery, BusinessChatLink, BusinessConnection, BusinessMessage, BusinessWorkHoursDay, CallbackQuery, Chat, ChatEvent, ChatInviteLink, ChatInviteLinkMember, ChatJoinRequestUpdate, ChatlistPreview, ChatMember, ChatMemberUpdate, ChatPreview, ChosenInlineResult, CollectibleInfo, DeleteBusinessMessageUpdate, DeleteMessageUpdate, DeleteStoryUpdate, Dialog, FactCheck, FileDownloadLocation, FileDownloadParameters, ForumTopic, FullChat, FullUser, GameHighScore, HistoryReadUpdate, InlineCallbackQuery, InlineQuery, InputChatEventFilters, InputDialogFolder, InputFileLike, InputInlineResult, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, PeerReaction, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SentCode, StarGift, StarGiftUnique, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStarGift, UserStatusUpdate, UserTypingUpdate, WebviewResult } from './types/index.js'
|
import type { AllStories, ArrayPaginated, ArrayWithTotal, Boost, BoostSlot, BoostStats, BotChatJoinRequestUpdate, BotCommands, BotReactionCountUpdate, BotReactionUpdate, BotStoppedUpdate, BusinessCallbackQuery, BusinessChatLink, BusinessConnection, BusinessMessage, BusinessWorkHoursDay, CallbackQuery, Chat, ChatEvent, ChatInviteLink, ChatInviteLinkMember, ChatJoinRequestUpdate, ChatlistPreview, ChatMember, ChatMemberUpdate, ChatPreview, ChosenInlineResult, CollectibleInfo, DeleteBusinessMessageUpdate, DeleteMessageUpdate, DeleteStoryUpdate, Dialog, FactCheck, FileDownloadLocation, FileDownloadParameters, ForumTopic, FullChat, FullUser, GameHighScore, HistoryReadUpdate, InlineCallbackQuery, InlineQuery, InputChatEventFilters, InputDialogFolder, InputFileLike, InputInlineResult, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, PeerReaction, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SentCode, StarGift, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStarGift, UserStatusUpdate, UserTypingUpdate, WebviewResult } from './types/index.js'
|
||||||
import type { ParsedUpdateHandlerParams } from './updates/parsed.js'
|
import type { ParsedUpdateHandlerParams } from './updates/parsed.js'
|
||||||
import type { RawUpdateInfo } from './updates/types.js'
|
import type { RawUpdateInfo } from './updates/types.js'
|
||||||
import type { InputStringSessionData } from './utils/string-session.js'
|
import type { InputStringSessionData } from './utils/string-session.js'
|
||||||
|
@ -224,7 +224,6 @@ import { getMyBoostSlots } from './methods/premium/get-my-boost-slots.js'
|
||||||
import { getStarGiftOptions } from './methods/premium/get-star-gift-options.js'
|
import { getStarGiftOptions } from './methods/premium/get-star-gift-options.js'
|
||||||
import { getStarGifts } from './methods/premium/get-star-gifts.js'
|
import { getStarGifts } from './methods/premium/get-star-gifts.js'
|
||||||
import { getStarsTransactions } from './methods/premium/get-stars-transactions.js'
|
import { getStarsTransactions } from './methods/premium/get-stars-transactions.js'
|
||||||
import { getUniqueStarGift } from './methods/premium/get-unique-star-gift.js'
|
|
||||||
import { iterBoosters } from './methods/premium/iter-boosters.js'
|
import { iterBoosters } from './methods/premium/iter-boosters.js'
|
||||||
import { iterStarGifts } from './methods/premium/iter-star-gifts.js'
|
import { iterStarGifts } from './methods/premium/iter-star-gifts.js'
|
||||||
import { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js'
|
import { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js'
|
||||||
|
@ -4747,11 +4746,6 @@ export interface TelegramClient extends ITelegramClient {
|
||||||
*/
|
*/
|
||||||
limit?: number
|
limit?: number
|
||||||
}): Promise<StarsStatus>
|
}): Promise<StarsStatus>
|
||||||
/**
|
|
||||||
* Get information about a unique star gift by its slug
|
|
||||||
*/
|
|
||||||
getUniqueStarGift(
|
|
||||||
slug: string): Promise<StarGiftUnique>
|
|
||||||
/**
|
/**
|
||||||
* Iterate over boosters of a channel.
|
* Iterate over boosters of a channel.
|
||||||
*
|
*
|
||||||
|
@ -6794,9 +6788,6 @@ TelegramClient.prototype.getStarGifts = function (...args) {
|
||||||
TelegramClient.prototype.getStarsTransactions = function (...args) {
|
TelegramClient.prototype.getStarsTransactions = function (...args) {
|
||||||
return getStarsTransactions(this._client, ...args)
|
return getStarsTransactions(this._client, ...args)
|
||||||
}
|
}
|
||||||
TelegramClient.prototype.getUniqueStarGift = function (...args) {
|
|
||||||
return getUniqueStarGift(this._client, ...args)
|
|
||||||
}
|
|
||||||
TelegramClient.prototype.iterBoosters = function (...args) {
|
TelegramClient.prototype.iterBoosters = function (...args) {
|
||||||
return iterBoosters(this._client, ...args)
|
return iterBoosters(this._client, ...args)
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,6 @@ export { getMyBoostSlots } from './methods/premium/get-my-boost-slots.js'
|
||||||
export { getStarGiftOptions } from './methods/premium/get-star-gift-options.js'
|
export { getStarGiftOptions } from './methods/premium/get-star-gift-options.js'
|
||||||
export { getStarGifts } from './methods/premium/get-star-gifts.js'
|
export { getStarGifts } from './methods/premium/get-star-gifts.js'
|
||||||
export { getStarsTransactions } from './methods/premium/get-stars-transactions.js'
|
export { getStarsTransactions } from './methods/premium/get-stars-transactions.js'
|
||||||
export { getUniqueStarGift } from './methods/premium/get-unique-star-gift.js'
|
|
||||||
export { iterBoosters } from './methods/premium/iter-boosters.js'
|
export { iterBoosters } from './methods/premium/iter-boosters.js'
|
||||||
export { iterStarGifts } from './methods/premium/iter-star-gifts.js'
|
export { iterStarGifts } from './methods/premium/iter-star-gifts.js'
|
||||||
export { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js'
|
export { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js'
|
||||||
|
|
|
@ -90,7 +90,6 @@ import {
|
||||||
ReplyMarkup,
|
ReplyMarkup,
|
||||||
SentCode,
|
SentCode,
|
||||||
StarGift,
|
StarGift,
|
||||||
StarGiftUnique,
|
|
||||||
StarsStatus,
|
StarsStatus,
|
||||||
StarsTransaction,
|
StarsTransaction,
|
||||||
Sticker,
|
Sticker,
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
import type { ITelegramClient } from '../../client.types.js'
|
|
||||||
import { assert } from '@fuman/utils'
|
|
||||||
import { PeersIndex, StarGiftUnique } from '../../types/index.js'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get information about a unique star gift by its slug
|
|
||||||
*/
|
|
||||||
export async function getUniqueStarGift(
|
|
||||||
client: ITelegramClient,
|
|
||||||
slug: string,
|
|
||||||
): Promise<StarGiftUnique> {
|
|
||||||
const res = await client.call({
|
|
||||||
_: 'payments.getUniqueStarGift',
|
|
||||||
slug,
|
|
||||||
})
|
|
||||||
|
|
||||||
const peers = PeersIndex.from(res)
|
|
||||||
|
|
||||||
assert(res.gift._ === 'starGiftUnique')
|
|
||||||
|
|
||||||
return new StarGiftUnique(res.gift, peers)
|
|
||||||
}
|
|
|
@ -139,22 +139,11 @@ export class StarGiftUnique {
|
||||||
return this.raw.title
|
return this.raw.title
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Slug of the gift */
|
/** ID of the user who owns this gift */
|
||||||
get slug(): string {
|
get owner(): User {
|
||||||
return this.raw.slug
|
|
||||||
}
|
|
||||||
|
|
||||||
/** ID of the user who owns this gift, if available */
|
|
||||||
get owner(): User | null {
|
|
||||||
if (!this.raw.ownerId) return null
|
|
||||||
return new User(this._peers.user(this.raw.ownerId))
|
return new User(this._peers.user(this.raw.ownerId))
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Name of the user who owns this gift, if available */
|
|
||||||
get ownerName(): string | null {
|
|
||||||
return this.raw.ownerName ?? null
|
|
||||||
}
|
|
||||||
|
|
||||||
get availabilityIssued(): number {
|
get availabilityIssued(): number {
|
||||||
return this.raw.availabilityIssued
|
return this.raw.availabilityIssued
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { MtTypeAssertionError } from '../../../../types/errors.js'
|
||||||
import { StoryInteractiveChannelPost } from './channel-post.js'
|
import { StoryInteractiveChannelPost } from './channel-post.js'
|
||||||
import { StoryInteractiveLocation } from './location.js'
|
import { StoryInteractiveLocation } from './location.js'
|
||||||
import { StoryInteractiveReaction } from './reaction.js'
|
import { StoryInteractiveReaction } from './reaction.js'
|
||||||
import { StoryInteractiveStarGift } from './star-gift.js'
|
|
||||||
import { StoryInteractiveUrl } from './url.js'
|
import { StoryInteractiveUrl } from './url.js'
|
||||||
import { StoryInteractiveVenue } from './venue.js'
|
import { StoryInteractiveVenue } from './venue.js'
|
||||||
import { StoryInteractiveWeather } from './weather.js'
|
import { StoryInteractiveWeather } from './weather.js'
|
||||||
|
@ -16,7 +15,6 @@ export {
|
||||||
StoryInteractiveChannelPost,
|
StoryInteractiveChannelPost,
|
||||||
StoryInteractiveLocation,
|
StoryInteractiveLocation,
|
||||||
StoryInteractiveReaction,
|
StoryInteractiveReaction,
|
||||||
StoryInteractiveStarGift,
|
|
||||||
StoryInteractiveUrl,
|
StoryInteractiveUrl,
|
||||||
StoryInteractiveVenue,
|
StoryInteractiveVenue,
|
||||||
StoryInteractiveWeather,
|
StoryInteractiveWeather,
|
||||||
|
@ -29,7 +27,6 @@ export type StoryInteractiveElement =
|
||||||
| StoryInteractiveChannelPost
|
| StoryInteractiveChannelPost
|
||||||
| StoryInteractiveUrl
|
| StoryInteractiveUrl
|
||||||
| StoryInteractiveWeather
|
| StoryInteractiveWeather
|
||||||
| StoryInteractiveStarGift
|
|
||||||
|
|
||||||
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
|
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
|
||||||
switch (raw._) {
|
switch (raw._) {
|
||||||
|
@ -45,8 +42,6 @@ export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: Pee
|
||||||
return new StoryInteractiveUrl(raw)
|
return new StoryInteractiveUrl(raw)
|
||||||
case 'mediaAreaWeather':
|
case 'mediaAreaWeather':
|
||||||
return new StoryInteractiveWeather(raw)
|
return new StoryInteractiveWeather(raw)
|
||||||
case 'mediaAreaStarGift':
|
|
||||||
return new StoryInteractiveStarGift(raw)
|
|
||||||
case 'inputMediaAreaVenue':
|
case 'inputMediaAreaVenue':
|
||||||
case 'inputMediaAreaChannelPost':
|
case 'inputMediaAreaChannelPost':
|
||||||
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)
|
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
import type { tl } from '@mtcute/tl'
|
|
||||||
|
|
||||||
import { makeInspectable } from '../../../utils/index.js'
|
|
||||||
|
|
||||||
import { StoryInteractiveArea } from './base.js'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interactive element containing a star gift
|
|
||||||
*/
|
|
||||||
export class StoryInteractiveStarGift extends StoryInteractiveArea {
|
|
||||||
readonly type = 'star_gift' as const
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
override readonly raw: tl.RawMediaAreaStarGift,
|
|
||||||
) {
|
|
||||||
super(raw)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Star gift slug */
|
|
||||||
get slug(): string {
|
|
||||||
return this.raw.slug
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
makeInspectable(StoryInteractiveStarGift)
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
TL schema and related utils used for mtcute.
|
TL schema and related utils used for mtcute.
|
||||||
|
|
||||||
Generated from TL layer **197** (last updated on 22.01.2025).
|
Generated from TL layer **196** (last updated on 01.01.2025).
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mtcute/tl",
|
"name": "@mtcute/tl",
|
||||||
"version": "197.0.0",
|
"version": "196.0.0",
|
||||||
"description": "TL schema used for mtcute",
|
"description": "TL schema used for mtcute",
|
||||||
"author": "alina sireneva <alina@tei.su>",
|
"author": "alina sireneva <alina@tei.su>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -22,7 +22,7 @@ export const TDESKTOP_LAYER
|
||||||
export const TDLIB_SCHEMA = 'https://raw.githubusercontent.com/tdlib/td/master/td/generate/scheme/telegram_api.tl'
|
export const TDLIB_SCHEMA = 'https://raw.githubusercontent.com/tdlib/td/master/td/generate/scheme/telegram_api.tl'
|
||||||
export const WEBK_SCHEMA = 'https://raw.githubusercontent.com/morethanwords/tweb/master/src/scripts/in/schema.json'
|
export const WEBK_SCHEMA = 'https://raw.githubusercontent.com/morethanwords/tweb/master/src/scripts/in/schema.json'
|
||||||
export const WEBA_SCHEMA = 'https://raw.githubusercontent.com/Ajaxy/telegram-tt/master/src/lib/gramjs/tl/static/api.tl'
|
export const WEBA_SCHEMA = 'https://raw.githubusercontent.com/Ajaxy/telegram-tt/master/src/lib/gramjs/tl/static/api.tl'
|
||||||
export const WEBA_LAYER = 'https://raw.githubusercontent.com/Ajaxy/telegram-tt/master/src/lib/gramjs/tl/AllTLObjects.ts'
|
export const WEBA_LAYER = 'https://raw.githubusercontent.com/Ajaxy/telegram-tt/master/src/lib/gramjs/tl/AllTLObjects.js'
|
||||||
|
|
||||||
export const ESM_PRELUDE = `// This file is auto-generated. Do not edit.
|
export const ESM_PRELUDE = `// This file is auto-generated. Do not edit.
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
@ -137,7 +137,7 @@ async function fetchWebaSchema(): Promise<Schema> {
|
||||||
])
|
])
|
||||||
|
|
||||||
// const LAYER = 174;
|
// const LAYER = 174;
|
||||||
const version = layerFile.match(/^export const LAYER = (\d+);$/m)
|
const version = layerFile.match(/^const LAYER = (\d+);$/m)
|
||||||
if (!version) throw new Error('Layer number not found')
|
if (!version) throw new Error('Layer number not found')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue