feat(tl): updated to layer 176
This commit is contained in:
parent
902196bdcf
commit
6828d56317
9 changed files with 11 additions and 10 deletions
|
@ -2117,7 +2117,7 @@ export interface TelegramClient extends ITelegramClient {
|
||||||
* **Available**: 👤 users only
|
* **Available**: 👤 users only
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getFolders(): Promise<tl.TypeDialogFilter[]>
|
getFolders(): Promise<tl.messages.RawDialogFilters>
|
||||||
/**
|
/**
|
||||||
* Get dialogs with certain peers.
|
* Get dialogs with certain peers.
|
||||||
*
|
*
|
||||||
|
|
|
@ -26,7 +26,7 @@ export async function createFolder(
|
||||||
// determine next id by finding max id
|
// determine next id by finding max id
|
||||||
// thanks durov for awesome api
|
// thanks durov for awesome api
|
||||||
let max = 1
|
let max = 1
|
||||||
old.forEach((it) => {
|
old.filters.forEach((it) => {
|
||||||
if (it._ === 'dialogFilter' && it.id > max) max = it.id
|
if (it._ === 'dialogFilter' && it.id > max) max = it.id
|
||||||
})
|
})
|
||||||
id = max + 1
|
id = max + 1
|
||||||
|
|
|
@ -33,7 +33,7 @@ export async function editFolder(
|
||||||
}
|
}
|
||||||
if (typeof folder === 'number' || typeof folder === 'string') {
|
if (typeof folder === 'number' || typeof folder === 'string') {
|
||||||
const old = await getFolders(client)
|
const old = await getFolders(client)
|
||||||
const found = old.find((it) => it._ === 'dialogFilter' && (it.id === folder || it.title === folder))
|
const found = old.filters.find((it) => it._ === 'dialogFilter' && (it.id === folder || it.title === folder))
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
throw new MtArgumentError(`Could not find a folder ${folder}`)
|
throw new MtArgumentError(`Could not find a folder ${folder}`)
|
||||||
|
|
|
@ -31,7 +31,7 @@ export async function findFolder(
|
||||||
const folders = await getFolders(client)
|
const folders = await getFolders(client)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
(folders.find((it) => {
|
(folders.filters.find((it) => {
|
||||||
if (it._ === 'dialogFilterDefault') return false
|
if (it._ === 'dialogFilterDefault') return false
|
||||||
if (params.id && it.id !== params.id) return false
|
if (params.id && it.id !== params.id) return false
|
||||||
if (params.title && it.title !== params.title) return false
|
if (params.title && it.title !== params.title) return false
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { InputDialogFolder } from '../../types/index.js'
|
||||||
/**
|
/**
|
||||||
* Get list of folders.
|
* Get list of folders.
|
||||||
*/
|
*/
|
||||||
export async function getFolders(client: ITelegramClient): Promise<tl.TypeDialogFilter[]> {
|
export async function getFolders(client: ITelegramClient): Promise<tl.messages.RawDialogFilters> {
|
||||||
return client.call({
|
return client.call({
|
||||||
_: 'messages.getDialogFilters',
|
_: 'messages.getDialogFilters',
|
||||||
})
|
})
|
||||||
|
@ -20,7 +20,7 @@ export async function _normalizeInputFolder(
|
||||||
): Promise<tl.TypeDialogFilter> {
|
): Promise<tl.TypeDialogFilter> {
|
||||||
if (typeof folder === 'string' || typeof folder === 'number') {
|
if (typeof folder === 'string' || typeof folder === 'number') {
|
||||||
const folders = await getFolders(client)
|
const folders = await getFolders(client)
|
||||||
const found = folders.find((it) => {
|
const found = folders.filters.find((it) => {
|
||||||
if (it._ === 'dialogFilterDefault') {
|
if (it._ === 'dialogFilterDefault') {
|
||||||
return folder === 0
|
return folder === 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
TL schema and related utils used for mtcute.
|
TL schema and related utils used for mtcute.
|
||||||
|
|
||||||
Generated from TL layer **174** (last updated on 19.02.2024).
|
Generated from TL layer **176** (last updated on 17.03.2024).
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11,6 +11,7 @@
|
||||||
"autoDownloadSettings": ["video_size_max", "file_size_max"],
|
"autoDownloadSettings": ["video_size_max", "file_size_max"],
|
||||||
"botInfo": ["user_id"],
|
"botInfo": ["user_id"],
|
||||||
"boost": ["user_id"],
|
"boost": ["user_id"],
|
||||||
|
"businessRecipients": ["users"],
|
||||||
"channel": ["id"],
|
"channel": ["id"],
|
||||||
"channelAdminLogEvent": ["user_id"],
|
"channelAdminLogEvent": ["user_id"],
|
||||||
"channelAdminLogEventActionChangeLinkedChat": ["prev_value", "new_value"],
|
"channelAdminLogEventActionChangeLinkedChat": ["prev_value", "new_value"],
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
"chatParticipantCreator": ["user_id"],
|
"chatParticipantCreator": ["user_id"],
|
||||||
"chatParticipants": ["chat_id"],
|
"chatParticipants": ["chat_id"],
|
||||||
"chatParticipantsForbidden": ["chat_id"],
|
"chatParticipantsForbidden": ["chat_id"],
|
||||||
|
"connectedBot": ["bot_id"],
|
||||||
"contact": ["user_id"],
|
"contact": ["user_id"],
|
||||||
"contactStatus": ["user_id"],
|
"contactStatus": ["user_id"],
|
||||||
"document": ["size"],
|
"document": ["size"],
|
||||||
|
@ -69,7 +71,6 @@
|
||||||
"messageMediaContact": ["user_id"],
|
"messageMediaContact": ["user_id"],
|
||||||
"messageMediaGiveaway": ["channels"],
|
"messageMediaGiveaway": ["channels"],
|
||||||
"messageReplies": ["channel_id"],
|
"messageReplies": ["channel_id"],
|
||||||
"messageReplyStoryHeader": ["user_id"],
|
|
||||||
"messageUserVote": ["user_id"],
|
"messageUserVote": ["user_id"],
|
||||||
"messageUserVoteInputOption": ["user_id"],
|
"messageUserVoteInputOption": ["user_id"],
|
||||||
"messageUserVoteMultiple": ["user_id"],
|
"messageUserVoteMultiple": ["user_id"],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mtcute/tl",
|
"name": "@mtcute/tl",
|
||||||
"version": "174.0.0",
|
"version": "176.0.0",
|
||||||
"description": "TL schema used for mtcute",
|
"description": "TL schema used for mtcute",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Alina Sireneva <alina@tei.su>",
|
"author": "Alina Sireneva <alina@tei.su>",
|
||||||
|
|
Loading…
Reference in a new issue