build(tl): updated to 182 layer

This commit is contained in:
alina 🌸 2024-06-25 00:50:38 +03:00
parent 470b6ca635
commit 80097fa8be
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
7 changed files with 41 additions and 4 deletions

View file

@ -5,16 +5,24 @@ import { PeersIndex } from '../../peers/index.js'
import { StoryInteractiveChannelPost } from './channel-post.js'
import { StoryInteractiveLocation } from './location.js'
import { StoryInteractiveReaction } from './reaction.js'
import { StoryInteractiveUrl } from './url.js'
import { StoryInteractiveVenue } from './venue.js'
export * from './input.js'
export { StoryInteractiveChannelPost, StoryInteractiveLocation, StoryInteractiveReaction, StoryInteractiveVenue }
export {
StoryInteractiveChannelPost,
StoryInteractiveLocation,
StoryInteractiveReaction,
StoryInteractiveUrl,
StoryInteractiveVenue,
}
export type StoryInteractiveElement =
| StoryInteractiveReaction
| StoryInteractiveLocation
| StoryInteractiveVenue
| StoryInteractiveChannelPost
| StoryInteractiveUrl
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
switch (raw._) {
@ -26,6 +34,8 @@ export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: Pee
return new StoryInteractiveVenue(raw)
case 'mediaAreaChannelPost':
return new StoryInteractiveChannelPost(raw, peers)
case 'mediaAreaUrl':
return new StoryInteractiveUrl(raw)
case 'inputMediaAreaVenue':
case 'inputMediaAreaChannelPost':
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)

View file

@ -130,4 +130,12 @@ export class StoryElement {
flipped: params.flipped,
}
}
url(url: string): tl.RawMediaAreaUrl {
return {
_: 'mediaAreaUrl',
coordinates: this._position,
url,
}
}
}

View file

@ -0,0 +1,18 @@
import { tl } from '@mtcute/tl'
import { StoryInteractiveArea } from './base.js'
/**
* Interactive element containing a URL link
*/
export class StoryInteractiveUrl extends StoryInteractiveArea {
readonly type = 'url' as const
constructor(readonly raw: tl.RawMediaAreaUrl) {
super(raw)
}
get url(): string {
return this.raw.url
}
}

View file

@ -2,7 +2,7 @@
TL schema and related utils used for mtcute.
Generated from TL layer **181** (last updated on 31.05.2024).
Generated from TL layer **182** (last updated on 25.06.2024).
## About

File diff suppressed because one or more lines are too long

View file

@ -107,6 +107,7 @@
"storyView": ["user_id"],
"storyViews": ["recent_viewers"],
"updateBotCallbackQuery": ["user_id"],
"updateBusinessBotCallbackQuery": ["user_id"],
"updateBotCommands": ["bot_id"],
"updateBotInlineQuery": ["user_id"],
"updateBotInlineSend": ["user_id"],

View file

@ -1,6 +1,6 @@
{
"name": "@mtcute/tl",
"version": "181.0.0",
"version": "182.0.0",
"description": "TL schema used for mtcute",
"author": "alina sireneva <alina@tei.su>",
"license": "MIT",