feat: updated to layer 185
This commit is contained in:
parent
34c63cbbc7
commit
4d912a6123
9 changed files with 84 additions and 4 deletions
|
@ -379,7 +379,7 @@ export async function _normalizeInputMedia(
|
||||||
if (media.type !== 'voice') {
|
if (media.type !== 'voice') {
|
||||||
attributes.push({
|
attributes.push({
|
||||||
_: 'documentAttributeFilename',
|
_: 'documentAttributeFilename',
|
||||||
fileName: media.fileName || inputFile.name,
|
fileName: media.fileName || (inputFile._ === 'inputFileStoryDocument' ? 'story' : inputFile.name),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,10 @@ export class Video extends RawDocument {
|
||||||
get ttlSeconds(): number | null {
|
get ttlSeconds(): number | null {
|
||||||
return this.media?.ttlSeconds ?? null
|
return this.media?.ttlSeconds ?? null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get videoStartTs(): number | null {
|
||||||
|
return this.attr._ === 'documentAttributeVideo' ? this.attr.videoStartTs ?? null : null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memoizeGetters(Video, ['fileName', 'thumbnails', 'fileId', 'uniqueFileId', 'isAnimation'])
|
memoizeGetters(Video, ['fileName', 'thumbnails', 'fileId', 'uniqueFileId', 'isAnimation'])
|
||||||
|
|
|
@ -474,6 +474,26 @@ export interface ActionPaymentRefunded {
|
||||||
charge: tl.TypePaymentCharge
|
charge: tl.TypePaymentCharge
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Telegram Stars were gifted by the other chat participant */
|
||||||
|
export interface ActionStarsGifted {
|
||||||
|
readonly type: 'stars_gifted'
|
||||||
|
|
||||||
|
/** Whether `currency` is a cryptocurrency */
|
||||||
|
isCrypto: boolean
|
||||||
|
|
||||||
|
/** Currency in which the stars were paid for */
|
||||||
|
currency: string
|
||||||
|
|
||||||
|
/** Amount of `currency` that was paid */
|
||||||
|
amount: tl.Long
|
||||||
|
|
||||||
|
/** Amount of Telegram Stars that were gifted */
|
||||||
|
stars: tl.Long
|
||||||
|
|
||||||
|
/** Transaction ID, if available */
|
||||||
|
transactionId?: string
|
||||||
|
}
|
||||||
|
|
||||||
export type MessageAction =
|
export type MessageAction =
|
||||||
| ActionChatCreated
|
| ActionChatCreated
|
||||||
| ActionChannelCreated
|
| ActionChannelCreated
|
||||||
|
@ -518,6 +538,7 @@ export type MessageAction =
|
||||||
| ActionGiveawayEnded
|
| ActionGiveawayEnded
|
||||||
| ActionBoostApply
|
| ActionBoostApply
|
||||||
| ActionPaymentRefunded
|
| ActionPaymentRefunded
|
||||||
|
| ActionStarsGifted
|
||||||
| null
|
| null
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
|
@ -784,6 +805,15 @@ export function _messageActionFromTl(this: Message, act: tl.TypeMessageAction):
|
||||||
payload: act.payload,
|
payload: act.payload,
|
||||||
charge: act.charge,
|
charge: act.charge,
|
||||||
}
|
}
|
||||||
|
case 'messageActionGiftStars':
|
||||||
|
return {
|
||||||
|
type: 'stars_gifted',
|
||||||
|
isCrypto: Boolean(act.cryptoCurrency),
|
||||||
|
currency: act.cryptoCurrency ?? act.currency,
|
||||||
|
amount: act.cryptoAmount ?? act.amount,
|
||||||
|
stars: act.stars,
|
||||||
|
transactionId: act.transactionId,
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,16 @@ export class User {
|
||||||
return this.raw.contactRequirePremium!
|
return this.raw.contactRequirePremium!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Number of bot's active users, if available */
|
||||||
|
get botActiveUsers(): number | null {
|
||||||
|
return this.raw.botActiveUsers ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Whether this bot has a main app */
|
||||||
|
get hasMainApp(): boolean {
|
||||||
|
return this.raw.botHasMainApp!
|
||||||
|
}
|
||||||
|
|
||||||
/** User's or bot's first name */
|
/** User's or bot's first name */
|
||||||
get firstName(): string {
|
get firstName(): string {
|
||||||
return this.raw.firstName ?? 'Deleted Account'
|
return this.raw.firstName ?? 'Deleted Account'
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { StoryInteractiveLocation } from './location.js'
|
||||||
import { StoryInteractiveReaction } from './reaction.js'
|
import { StoryInteractiveReaction } from './reaction.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'
|
||||||
|
|
||||||
export * from './input.js'
|
export * from './input.js'
|
||||||
export {
|
export {
|
||||||
|
@ -15,6 +16,7 @@ export {
|
||||||
StoryInteractiveReaction,
|
StoryInteractiveReaction,
|
||||||
StoryInteractiveUrl,
|
StoryInteractiveUrl,
|
||||||
StoryInteractiveVenue,
|
StoryInteractiveVenue,
|
||||||
|
StoryInteractiveWeather,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StoryInteractiveElement =
|
export type StoryInteractiveElement =
|
||||||
|
@ -23,6 +25,7 @@ export type StoryInteractiveElement =
|
||||||
| StoryInteractiveVenue
|
| StoryInteractiveVenue
|
||||||
| StoryInteractiveChannelPost
|
| StoryInteractiveChannelPost
|
||||||
| StoryInteractiveUrl
|
| StoryInteractiveUrl
|
||||||
|
| StoryInteractiveWeather
|
||||||
|
|
||||||
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
|
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
|
||||||
switch (raw._) {
|
switch (raw._) {
|
||||||
|
@ -36,6 +39,8 @@ export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: Pee
|
||||||
return new StoryInteractiveChannelPost(raw, peers)
|
return new StoryInteractiveChannelPost(raw, peers)
|
||||||
case 'mediaAreaUrl':
|
case 'mediaAreaUrl':
|
||||||
return new StoryInteractiveUrl(raw)
|
return new StoryInteractiveUrl(raw)
|
||||||
|
case 'mediaAreaWeather':
|
||||||
|
return new StoryInteractiveWeather(raw)
|
||||||
case 'inputMediaAreaVenue':
|
case 'inputMediaAreaVenue':
|
||||||
case 'inputMediaAreaChannelPost':
|
case 'inputMediaAreaChannelPost':
|
||||||
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)
|
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { tl } from '@mtcute/tl'
|
||||||
|
|
||||||
|
import { makeInspectable } from '../../../utils/index.js'
|
||||||
|
import { StoryInteractiveArea } from './base.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interactive element containing a weather info
|
||||||
|
*/
|
||||||
|
export class StoryInteractiveWeather extends StoryInteractiveArea {
|
||||||
|
readonly type = 'weather' as const
|
||||||
|
|
||||||
|
constructor(readonly raw: tl.RawMediaAreaWeather) {
|
||||||
|
super(raw)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Emoji representing the weather */
|
||||||
|
get emoji(): string {
|
||||||
|
return this.raw.emoji
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Temperature in Celsius */
|
||||||
|
get temperature(): number {
|
||||||
|
return this.raw.temperatureC
|
||||||
|
}
|
||||||
|
|
||||||
|
get color(): number {
|
||||||
|
return this.raw.color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
makeInspectable(StoryInteractiveWeather)
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
TL schema and related utils used for mtcute.
|
TL schema and related utils used for mtcute.
|
||||||
|
|
||||||
Generated from TL layer **184** (last updated on 08.07.2024).
|
Generated from TL layer **185** (last updated on 31.07.2024).
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mtcute/tl",
|
"name": "@mtcute/tl",
|
||||||
"version": "184.0.0",
|
"version": "185.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",
|
||||||
|
|
Loading…
Reference in a new issue