build(tl): updated to 182 layer
This commit is contained in:
parent
470b6ca635
commit
80097fa8be
7 changed files with 41 additions and 4 deletions
|
@ -5,16 +5,24 @@ import { PeersIndex } from '../../peers/index.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 { StoryInteractiveUrl } from './url.js'
|
||||||
import { StoryInteractiveVenue } from './venue.js'
|
import { StoryInteractiveVenue } from './venue.js'
|
||||||
|
|
||||||
export * from './input.js'
|
export * from './input.js'
|
||||||
export { StoryInteractiveChannelPost, StoryInteractiveLocation, StoryInteractiveReaction, StoryInteractiveVenue }
|
export {
|
||||||
|
StoryInteractiveChannelPost,
|
||||||
|
StoryInteractiveLocation,
|
||||||
|
StoryInteractiveReaction,
|
||||||
|
StoryInteractiveUrl,
|
||||||
|
StoryInteractiveVenue,
|
||||||
|
}
|
||||||
|
|
||||||
export type StoryInteractiveElement =
|
export type StoryInteractiveElement =
|
||||||
| StoryInteractiveReaction
|
| StoryInteractiveReaction
|
||||||
| StoryInteractiveLocation
|
| StoryInteractiveLocation
|
||||||
| StoryInteractiveVenue
|
| StoryInteractiveVenue
|
||||||
| StoryInteractiveChannelPost
|
| StoryInteractiveChannelPost
|
||||||
|
| StoryInteractiveUrl
|
||||||
|
|
||||||
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
|
export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: PeersIndex): StoryInteractiveElement {
|
||||||
switch (raw._) {
|
switch (raw._) {
|
||||||
|
@ -26,6 +34,8 @@ export function _storyInteractiveElementFromTl(raw: tl.TypeMediaArea, peers: Pee
|
||||||
return new StoryInteractiveVenue(raw)
|
return new StoryInteractiveVenue(raw)
|
||||||
case 'mediaAreaChannelPost':
|
case 'mediaAreaChannelPost':
|
||||||
return new StoryInteractiveChannelPost(raw, peers)
|
return new StoryInteractiveChannelPost(raw, peers)
|
||||||
|
case 'mediaAreaUrl':
|
||||||
|
return new StoryInteractiveUrl(raw)
|
||||||
case 'inputMediaAreaVenue':
|
case 'inputMediaAreaVenue':
|
||||||
case 'inputMediaAreaChannelPost':
|
case 'inputMediaAreaChannelPost':
|
||||||
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)
|
throw new MtTypeAssertionError('StoryInteractiveElement', '!input*', raw._)
|
||||||
|
|
|
@ -130,4 +130,12 @@ export class StoryElement {
|
||||||
flipped: params.flipped,
|
flipped: params.flipped,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
url(url: string): tl.RawMediaAreaUrl {
|
||||||
|
return {
|
||||||
|
_: 'mediaAreaUrl',
|
||||||
|
coordinates: this._position,
|
||||||
|
url,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
18
packages/core/src/highlevel/types/stories/interactive/url.ts
Normal file
18
packages/core/src/highlevel/types/stories/interactive/url.ts
Normal 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
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
TL schema and related utils used for mtcute.
|
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
|
## About
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -107,6 +107,7 @@
|
||||||
"storyView": ["user_id"],
|
"storyView": ["user_id"],
|
||||||
"storyViews": ["recent_viewers"],
|
"storyViews": ["recent_viewers"],
|
||||||
"updateBotCallbackQuery": ["user_id"],
|
"updateBotCallbackQuery": ["user_id"],
|
||||||
|
"updateBusinessBotCallbackQuery": ["user_id"],
|
||||||
"updateBotCommands": ["bot_id"],
|
"updateBotCommands": ["bot_id"],
|
||||||
"updateBotInlineQuery": ["user_id"],
|
"updateBotInlineQuery": ["user_id"],
|
||||||
"updateBotInlineSend": ["user_id"],
|
"updateBotInlineSend": ["user_id"],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mtcute/tl",
|
"name": "@mtcute/tl",
|
||||||
"version": "181.0.0",
|
"version": "182.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