فهرست منبع

Defaults DC to 4 instead of 1
Update tl layer

painor 4 سال پیش
والد
کامیت
2a77adedd6

+ 3 - 3
gramjs/client/telegramBaseClient.ts

@@ -16,9 +16,9 @@ import type { EventBuilder } from "../events/common";
 import { MarkdownParser } from "../extensions/markdown";
 import { MTProtoSender } from "../network";
 
-const DEFAULT_DC_ID = 1;
-const DEFAULT_IPV4_IP = IS_NODE ? "149.154.167.51" : "pluto.web.telegram.org";
-const DEFAULT_IPV6_IP = "2001:67c:4e8:f002::a";
+const DEFAULT_DC_ID = 4;
+const DEFAULT_IPV4_IP = IS_NODE ? "149.154.167.91" : "vesta.web.telegram.org";
+const DEFAULT_IPV6_IP = "2001:067c:04e8:f004:0000:0000:0000:000a";
 
 /**
  * Interface for creating a new client.

+ 26 - 4
gramjs/extensions/MessagePacker.ts

@@ -4,6 +4,15 @@ import { BinaryWriter } from "./BinaryWriter";
 import type { MTProtoState } from "../network/MTProtoState";
 import type { RequestState } from "../network/RequestState";
 
+const USE_INVOKE_AFTER_WITH = [
+    "messages.SendMessage",
+    "messages.SendMedia",
+    "messages.SendMultiMedia",
+    "messages.ForwardMessages",
+    "messages.SendInlineBotResult",
+    "users.GetUsers",
+];
+
 export class MessagePacker {
     private _state: any;
     private _queue: any[];
@@ -25,7 +34,23 @@ export class MessagePacker {
     }
 
     append(state: RequestState) {
+        // we need to check if there is already a request with the same name that we should send after.
+        if (USE_INVOKE_AFTER_WITH.includes(state.request.className)) {
+            // we now need to check if there is any request in queue already.
+            for (let i = this._queue.length - 1; i >= 0; i--) {
+                if (
+                    USE_INVOKE_AFTER_WITH.includes(
+                        this._queue[i].request.className
+                    )
+                ) {
+                    state.after = this._queue[i];
+                    break;
+                }
+            }
+        }
+
         this._queue.push(state);
+
         if (this.setReady) {
             this.setReady(true);
         }
@@ -33,10 +58,7 @@ export class MessagePacker {
 
     extend(states: RequestState[]) {
         for (const state of states) {
-            this._queue.push(state);
-        }
-        if (this.setReady) {
-            this.setReady(true);
+            this.append(state);
         }
     }
 

+ 5 - 1
gramjs/network/MTProtoState.ts

@@ -122,7 +122,11 @@ export class MTProtoState {
                 contentRelated,
                 new Api.InvokeAfterMsg({
                     msgId: afterId,
-                    query: data,
+                    query: {
+                        getBytes() {
+                            return data;
+                        },
+                    },
                 }).getBytes()
             );
         }

+ 1 - 1
gramjs/tl/AllTLObjects.ts

@@ -1,6 +1,6 @@
 import { Api } from "./";
 
-export const LAYER = 128;
+export const LAYER = 131;
 const tlobjects: any = {};
 
 for (const tl of Object.values(Api)) {

+ 264 - 23
gramjs/tl/api.d.ts

@@ -274,8 +274,6 @@ export namespace Api {
     }
     export class InputMediaInvoice extends VirtualClass<{
         // flags: null;
-        multipleAllowed?: boolean;
-        canForward?: boolean;
         title: string;
         description: string;
         photo?: Api.TypeInputWebDocument;
@@ -283,12 +281,10 @@ export namespace Api {
         payload: bytes;
         provider: string;
         providerData: Api.TypeDataJSON;
-        startParam: string;
+        startParam?: string;
     }> {
         static fromReader(reader: Reader): InputMediaInvoice;
         // flags: null;
-        multipleAllowed?: boolean;
-        canForward?: boolean;
         title: string;
         description: string;
         photo?: Api.TypeInputWebDocument;
@@ -296,7 +292,7 @@ export namespace Api {
         payload: bytes;
         provider: string;
         providerData: Api.TypeDataJSON;
-        startParam: string;
+        startParam?: string;
     }
     export class InputMediaGeoLive extends VirtualClass<{
         // flags: null;
@@ -1589,12 +1585,14 @@ export namespace Api {
         settings?: Api.TypeWallPaperSettings;
     }
     export class WallPaperNoFile extends VirtualClass<{
+        id: long;
         // flags: null;
         default?: boolean;
         dark?: boolean;
         settings?: Api.TypeWallPaperSettings;
     }> {
         static fromReader(reader: Reader): WallPaperNoFile;
+        id: long;
         // flags: null;
         default?: boolean;
         dark?: boolean;
@@ -2411,11 +2409,13 @@ export namespace Api {
         pollId: long;
         userId: int;
         options: bytes[];
+        qts: int;
     }> {
         static fromReader(reader: Reader): UpdateMessagePollVote;
         pollId: long;
         userId: int;
         options: bytes[];
+        qts: int;
     }
     export class UpdateDialogFilter extends VirtualClass<{
         // flags: null;
@@ -2624,6 +2624,26 @@ export namespace Api {
         stopped: Bool;
         qts: int;
     }
+    export class UpdateGroupCallConnection extends VirtualClass<{
+        // flags: null;
+        presentation?: boolean;
+        params: Api.TypeDataJSON;
+    }> {
+        static fromReader(reader: Reader): UpdateGroupCallConnection;
+        // flags: null;
+        presentation?: boolean;
+        params: Api.TypeDataJSON;
+    }
+    export class UpdateBotCommands extends VirtualClass<{
+        peer: Api.TypePeer;
+        botId: int;
+        commands: Api.TypeBotCommand[];
+    }> {
+        static fromReader(reader: Reader): UpdateBotCommands;
+        peer: Api.TypePeer;
+        botId: int;
+        commands: Api.TypeBotCommand[];
+    }
     export class UpdatesTooLong extends VirtualClass<void> {
         static fromReader(reader: Reader): UpdatesTooLong;
     }
@@ -3748,11 +3768,13 @@ export namespace Api {
         // flags: null;
         singleUse?: boolean;
         selective?: boolean;
+        placeholder?: string;
     }> {
         static fromReader(reader: Reader): ReplyKeyboardForceReply;
         // flags: null;
         singleUse?: boolean;
         selective?: boolean;
+        placeholder?: string;
     }
     export class ReplyKeyboardMarkup extends VirtualClass<{
         // flags: null;
@@ -3760,6 +3782,7 @@ export namespace Api {
         singleUse?: boolean;
         selective?: boolean;
         rows: Api.TypeKeyboardButtonRow[];
+        placeholder?: string;
     }> {
         static fromReader(reader: Reader): ReplyKeyboardMarkup;
         // flags: null;
@@ -3767,6 +3790,7 @@ export namespace Api {
         singleUse?: boolean;
         selective?: boolean;
         rows: Api.TypeKeyboardButtonRow[];
+        placeholder?: string;
     }
     export class ReplyInlineMarkup extends VirtualClass<{
         rows: Api.TypeKeyboardButtonRow[];
@@ -4181,8 +4205,6 @@ export namespace Api {
     }
     export class InputBotInlineMessageMediaInvoice extends VirtualClass<{
         // flags: null;
-        multipleAllowed?: boolean;
-        canForward?: boolean;
         title: string;
         description: string;
         photo?: Api.TypeInputWebDocument;
@@ -4190,13 +4212,10 @@ export namespace Api {
         payload: bytes;
         provider: string;
         providerData: Api.TypeDataJSON;
-        startParam: string;
         replyMarkup?: Api.TypeReplyMarkup;
     }> {
         static fromReader(reader: Reader): InputBotInlineMessageMediaInvoice;
         // flags: null;
-        multipleAllowed?: boolean;
-        canForward?: boolean;
         title: string;
         description: string;
         photo?: Api.TypeInputWebDocument;
@@ -4204,7 +4223,6 @@ export namespace Api {
         payload: bytes;
         provider: string;
         providerData: Api.TypeDataJSON;
-        startParam: string;
         replyMarkup?: Api.TypeReplyMarkup;
     }
     export class InputBotInlineResult extends VirtualClass<{
@@ -6585,8 +6603,11 @@ export namespace Api {
         static fromReader(reader: Reader): InputWallPaperSlug;
         slug: string;
     }
-    export class InputWallPaperNoFile extends VirtualClass<void> {
+    export class InputWallPaperNoFile extends VirtualClass<{
+        id: long;
+    }> {
         static fromReader(reader: Reader): InputWallPaperNoFile;
+        id: long;
     }
     export class CodeSettings extends VirtualClass<{
         // flags: null;
@@ -6606,6 +6627,8 @@ export namespace Api {
         motion?: boolean;
         backgroundColor?: int;
         secondBackgroundColor?: int;
+        thirdBackgroundColor?: int;
+        fourthBackgroundColor?: int;
         intensity?: int;
         rotation?: int;
     }> {
@@ -6615,6 +6638,8 @@ export namespace Api {
         motion?: boolean;
         backgroundColor?: int;
         secondBackgroundColor?: int;
+        thirdBackgroundColor?: int;
+        fourthBackgroundColor?: int;
         intensity?: int;
         rotation?: int;
     }
@@ -7125,14 +7150,16 @@ export namespace Api {
         canChangeJoinMuted?: boolean;
         joinDateAsc?: boolean;
         scheduleStartSubscribed?: boolean;
+        canStartVideo?: boolean;
         id: long;
         accessHash: long;
         participantsCount: int;
-        params?: Api.TypeDataJSON;
         title?: string;
         streamDcId?: int;
         recordStartDate?: int;
         scheduleDate?: int;
+        unmutedVideoCount?: int;
+        unmutedVideoLimit: int;
         version: int;
     }> {
         static fromReader(reader: Reader): GroupCall;
@@ -7141,14 +7168,16 @@ export namespace Api {
         canChangeJoinMuted?: boolean;
         joinDateAsc?: boolean;
         scheduleStartSubscribed?: boolean;
+        canStartVideo?: boolean;
         id: long;
         accessHash: long;
         participantsCount: int;
-        params?: Api.TypeDataJSON;
         title?: string;
         streamDcId?: int;
         recordStartDate?: int;
         scheduleDate?: int;
+        unmutedVideoCount?: int;
+        unmutedVideoLimit: int;
         version: int;
     }
     export class InputGroupCall extends VirtualClass<{
@@ -7170,6 +7199,7 @@ export namespace Api {
         mutedByYou?: boolean;
         volumeByAdmin?: boolean;
         self?: boolean;
+        videoJoined?: boolean;
         peer: Api.TypePeer;
         date: int;
         activeDate?: int;
@@ -7177,7 +7207,8 @@ export namespace Api {
         volume?: int;
         about?: string;
         raiseHandRating?: long;
-        params?: Api.TypeDataJSON;
+        video?: Api.TypeGroupCallParticipantVideo;
+        presentation?: Api.TypeGroupCallParticipantVideo;
     }> {
         static fromReader(reader: Reader): GroupCallParticipant;
         // flags: null;
@@ -7190,6 +7221,7 @@ export namespace Api {
         mutedByYou?: boolean;
         volumeByAdmin?: boolean;
         self?: boolean;
+        videoJoined?: boolean;
         peer: Api.TypePeer;
         date: int;
         activeDate?: int;
@@ -7197,7 +7229,8 @@ export namespace Api {
         volume?: int;
         about?: string;
         raiseHandRating?: long;
-        params?: Api.TypeDataJSON;
+        video?: Api.TypeGroupCallParticipantVideo;
+        presentation?: Api.TypeGroupCallParticipantVideo;
     }
     export class InlineQueryPeerTypeSameBotPM extends VirtualClass<void> {
         static fromReader(reader: Reader): InlineQueryPeerTypeSameBotPM;
@@ -7232,6 +7265,60 @@ export namespace Api {
         invitesCount: int;
         revokedInvitesCount: int;
     }
+    export class GroupCallParticipantVideoSourceGroup extends VirtualClass<{
+        semantics: string;
+        sources: int[];
+    }> {
+        static fromReader(reader: Reader): GroupCallParticipantVideoSourceGroup;
+        semantics: string;
+        sources: int[];
+    }
+    export class GroupCallParticipantVideo extends VirtualClass<{
+        // flags: null;
+        paused?: boolean;
+        endpoint: string;
+        sourceGroups: Api.TypeGroupCallParticipantVideoSourceGroup[];
+        audioSource?: int;
+    }> {
+        static fromReader(reader: Reader): GroupCallParticipantVideo;
+        // flags: null;
+        paused?: boolean;
+        endpoint: string;
+        sourceGroups: Api.TypeGroupCallParticipantVideoSourceGroup[];
+        audioSource?: int;
+    }
+    export class BotCommandScopeDefault extends VirtualClass<void> {
+        static fromReader(reader: Reader): BotCommandScopeDefault;
+    }
+    export class BotCommandScopeUsers extends VirtualClass<void> {
+        static fromReader(reader: Reader): BotCommandScopeUsers;
+    }
+    export class BotCommandScopeChats extends VirtualClass<void> {
+        static fromReader(reader: Reader): BotCommandScopeChats;
+    }
+    export class BotCommandScopeChatAdmins extends VirtualClass<void> {
+        static fromReader(reader: Reader): BotCommandScopeChatAdmins;
+    }
+    export class BotCommandScopePeer extends VirtualClass<{
+        peer: Api.TypeInputPeer;
+    }> {
+        static fromReader(reader: Reader): BotCommandScopePeer;
+        peer: Api.TypeInputPeer;
+    }
+    export class BotCommandScopePeerAdmins extends VirtualClass<{
+        peer: Api.TypeInputPeer;
+    }> {
+        static fromReader(reader: Reader): BotCommandScopePeerAdmins;
+        peer: Api.TypeInputPeer;
+    }
+    export class BotCommandScopePeerUser extends VirtualClass<{
+        peer: Api.TypeInputPeer;
+        userId: Api.TypeInputUser;
+    }> {
+        static fromReader(reader: Reader): BotCommandScopePeerUser;
+        peer: Api.TypeInputPeer;
+        userId: Api.TypeInputUser;
+    }
     export class ResPQ extends VirtualClass<{
         nonce: int128;
         serverNonce: int128;
@@ -8774,6 +8861,7 @@ export namespace Api {
             entities: Api.TypeMessageEntity[];
             document?: Api.TypeDocument;
             url?: string;
+            sticker?: Api.TypeDocument;
         }> {
             static fromReader(reader: Reader): AppUpdate;
             // flags: null;
@@ -8784,6 +8872,7 @@ export namespace Api {
             entities: Api.TypeMessageEntity[];
             document?: Api.TypeDocument;
             url?: string;
+            sticker?: Api.TypeDocument;
         }
         export class NoAppUpdate extends VirtualClass<void> {
             static fromReader(reader: Reader): NoAppUpdate;
@@ -8996,6 +9085,7 @@ export namespace Api {
             newAlgo: Api.TypePasswordKdfAlgo;
             newSecureAlgo: Api.TypeSecurePasswordKdfAlgo;
             secureRandom: bytes;
+            pendingResetDate?: int;
         }> {
             static fromReader(reader: Reader): Password;
             // flags: null;
@@ -9010,6 +9100,7 @@ export namespace Api {
             newAlgo: Api.TypePasswordKdfAlgo;
             newSecureAlgo: Api.TypeSecurePasswordKdfAlgo;
             secureRandom: bytes;
+            pendingResetDate?: int;
         }
         export class PasswordSettings extends VirtualClass<{
             // flags: null;
@@ -9125,6 +9216,21 @@ export namespace Api {
             sensitiveEnabled?: boolean;
             sensitiveCanChange?: boolean;
         }
+        export class ResetPasswordFailedWait extends VirtualClass<{
+            retryDate: int;
+        }> {
+            static fromReader(reader: Reader): ResetPasswordFailedWait;
+            retryDate: int;
+        }
+        export class ResetPasswordRequestedWait extends VirtualClass<{
+            untilDate: int;
+        }> {
+            static fromReader(reader: Reader): ResetPasswordRequestedWait;
+            untilDate: int;
+        }
+        export class ResetPasswordOk extends VirtualClass<void> {
+            static fromReader(reader: Reader): ResetPasswordOk;
+        }
     }
 
     export namespace channels {
@@ -9410,6 +9516,15 @@ export namespace Api {
         }
     }
 
+    export namespace stickers {
+        export class SuggestedShortName extends VirtualClass<{
+            shortName: string;
+        }> {
+            static fromReader(reader: Reader): SuggestedShortName;
+            shortName: string;
+        }
+    }
+
     export namespace storage {
         export type TypeFileType =
             | storage.FileUnknown
@@ -9596,6 +9711,10 @@ export namespace Api {
         export type TypeAutoDownloadSettings = account.AutoDownloadSettings;
         export type TypeThemes = account.ThemesNotModified | account.Themes;
         export type TypeContentSettings = account.ContentSettings;
+        export type TypeResetPasswordResult =
+            | account.ResetPasswordFailedWait
+            | account.ResetPasswordRequestedWait
+            | account.ResetPasswordOk;
     }
 
     export namespace channels {
@@ -9632,6 +9751,10 @@ export namespace Api {
         export type TypeMessageStats = stats.MessageStats;
     }
 
+    export namespace stickers {
+        export type TypeSuggestedShortName = stickers.SuggestedShortName;
+    }
+
     export namespace auth {
         export class SendCode extends Request<
             Partial<{
@@ -9749,12 +9872,16 @@ export namespace Api {
         }
         export class RecoverPassword extends Request<
             Partial<{
+                // flags: null;
                 code: string;
+                newSettings?: account.TypePasswordInputSettings;
             }>,
             auth.TypeAuthorization
         > {
             static fromReader(reader: Reader): RecoverPassword;
+            // flags: null;
             code: string;
+            newSettings?: account.TypePasswordInputSettings;
         }
         export class ResendCode extends Request<
             Partial<{
@@ -9818,6 +9945,15 @@ export namespace Api {
             static fromReader(reader: Reader): AcceptLoginToken;
             token: bytes;
         }
+        export class CheckRecoveryPassword extends Request<
+            Partial<{
+                code: string;
+            }>,
+            Bool
+        > {
+            static fromReader(reader: Reader): CheckRecoveryPassword;
+            code: string;
+        }
     }
 
     export namespace account {
@@ -10522,6 +10658,15 @@ export namespace Api {
             reason: Api.TypeReportReason;
             message: string;
         }
+        export class ResetPassword extends Request<
+            void,
+            account.TypeResetPasswordResult
+        > {
+            static fromReader(reader: Reader): ResetPassword;
+        }
+        export class DeclinePasswordReset extends Request<void, Bool> {
+            static fromReader(reader: Reader): DeclinePasswordReset;
+        }
     }
 
     export namespace users {
@@ -13484,13 +13629,39 @@ export namespace Api {
         }
         export class SetBotCommands extends Request<
             Partial<{
+                scope: Api.TypeBotCommandScope;
+                langCode: string;
                 commands: Api.TypeBotCommand[];
             }>,
             Bool
         > {
             static fromReader(reader: Reader): SetBotCommands;
+            scope: Api.TypeBotCommandScope;
+            langCode: string;
             commands: Api.TypeBotCommand[];
         }
+        export class ResetBotCommands extends Request<
+            Partial<{
+                scope: Api.TypeBotCommandScope;
+                langCode: string;
+            }>,
+            Bool
+        > {
+            static fromReader(reader: Reader): ResetBotCommands;
+            scope: Api.TypeBotCommandScope;
+            langCode: string;
+        }
+        export class GetBotCommands extends Request<
+            Partial<{
+                scope: Api.TypeBotCommandScope;
+                langCode: string;
+            }>,
+            Api.TypeBotCommand[]
+        > {
+            static fromReader(reader: Reader): GetBotCommands;
+            scope: Api.TypeBotCommandScope;
+            langCode: string;
+        }
     }
 
     export namespace payments {
@@ -13601,6 +13772,7 @@ export namespace Api {
                 shortName: string;
                 thumb?: Api.TypeInputDocument;
                 stickers: Api.TypeInputStickerSetItem[];
+                software?: string;
             }>,
             messages.TypeStickerSet
         > {
@@ -13613,6 +13785,7 @@ export namespace Api {
             shortName: string;
             thumb?: Api.TypeInputDocument;
             stickers: Api.TypeInputStickerSetItem[];
+            software?: string;
         }
         export class RemoveStickerFromSet extends Request<
             Partial<{
@@ -13656,6 +13829,24 @@ export namespace Api {
             stickerset: Api.TypeInputStickerSet;
             thumb: Api.TypeInputDocument;
         }
+        export class CheckShortName extends Request<
+            Partial<{
+                shortName: string;
+            }>,
+            Bool
+        > {
+            static fromReader(reader: Reader): CheckShortName;
+            shortName: string;
+        }
+        export class SuggestShortName extends Request<
+            Partial<{
+                title: string;
+            }>,
+            stickers.TypeSuggestedShortName
+        > {
+            static fromReader(reader: Reader): SuggestShortName;
+            title: string;
+        }
     }
 
     export namespace phone {
@@ -13797,6 +13988,7 @@ export namespace Api {
             Partial<{
                 // flags: null;
                 muted?: boolean;
+                videoStopped?: boolean;
                 call: Api.TypeInputGroupCall;
                 joinAs: Api.TypeEntityLike;
                 inviteHash?: string;
@@ -13807,6 +13999,7 @@ export namespace Api {
             static fromReader(reader: Reader): JoinGroupCall;
             // flags: null;
             muted?: boolean;
+            videoStopped?: boolean;
             call: Api.TypeInputGroupCall;
             joinAs: Api.TypeEntityLike;
             inviteHash?: string;
@@ -13887,13 +14080,13 @@ export namespace Api {
         export class CheckGroupCall extends Request<
             Partial<{
                 call: Api.TypeInputGroupCall;
-                source: int;
+                sources: int[];
             }>,
-            Bool
+            int[]
         > {
             static fromReader(reader: Reader): CheckGroupCall;
             call: Api.TypeInputGroupCall;
-            source: int;
+            sources: int[];
         }
         export class ToggleGroupCallRecord extends Request<
             Partial<{
@@ -13913,21 +14106,27 @@ export namespace Api {
         export class EditGroupCallParticipant extends Request<
             Partial<{
                 // flags: null;
-                muted?: boolean;
                 call: Api.TypeInputGroupCall;
                 participant: Api.TypeEntityLike;
+                muted?: Bool;
                 volume?: int;
                 raiseHand?: Bool;
+                videoStopped?: Bool;
+                videoPaused?: Bool;
+                presentationPaused?: Bool;
             }>,
             Api.TypeUpdates
         > {
             static fromReader(reader: Reader): EditGroupCallParticipant;
             // flags: null;
-            muted?: boolean;
             call: Api.TypeInputGroupCall;
             participant: Api.TypeEntityLike;
+            muted?: Bool;
             volume?: int;
             raiseHand?: Bool;
+            videoStopped?: Bool;
+            videoPaused?: Bool;
+            presentationPaused?: Bool;
         }
         export class EditGroupCallTitle extends Request<
             Partial<{
@@ -13993,6 +14192,26 @@ export namespace Api {
             peer: Api.TypeEntityLike;
             joinAs: Api.TypeEntityLike;
         }
+        export class JoinGroupCallPresentation extends Request<
+            Partial<{
+                call: Api.TypeInputGroupCall;
+                params: Api.TypeDataJSON;
+            }>,
+            Api.TypeUpdates
+        > {
+            static fromReader(reader: Reader): JoinGroupCallPresentation;
+            call: Api.TypeInputGroupCall;
+            params: Api.TypeDataJSON;
+        }
+        export class LeaveGroupCallPresentation extends Request<
+            Partial<{
+                call: Api.TypeInputGroupCall;
+            }>,
+            Api.TypeUpdates
+        > {
+            static fromReader(reader: Reader): LeaveGroupCallPresentation;
+            call: Api.TypeInputGroupCall;
+        }
     }
 
     export namespace langpack {
@@ -14412,7 +14631,9 @@ export namespace Api {
         | UpdatePeerHistoryTTL
         | UpdateChatParticipant
         | UpdateChannelParticipant
-        | UpdateBotStopped;
+        | UpdateBotStopped
+        | UpdateGroupCallConnection
+        | UpdateBotCommands;
     export type TypeUpdates =
         | UpdatesTooLong
         | UpdateShortMessage
@@ -14918,6 +15139,17 @@ export namespace Api {
         | InlineQueryPeerTypeBroadcast;
     export type TypeChatInviteImporter = ChatInviteImporter;
     export type TypeChatAdminWithInvites = ChatAdminWithInvites;
+    export type TypeGroupCallParticipantVideoSourceGroup =
+        GroupCallParticipantVideoSourceGroup;
+    export type TypeGroupCallParticipantVideo = GroupCallParticipantVideo;
+    export type TypeBotCommandScope =
+        | BotCommandScopeDefault
+        | BotCommandScopeUsers
+        | BotCommandScopeChats
+        | BotCommandScopeChatAdmins
+        | BotCommandScopePeer
+        | BotCommandScopePeerAdmins
+        | BotCommandScopePeerUser;
     export type TypeResPQ = ResPQ;
     export type TypeP_Q_inner_data =
         | PQInnerData
@@ -15002,6 +15234,7 @@ export namespace Api {
         | auth.ExportLoginToken
         | auth.ImportLoginToken
         | auth.AcceptLoginToken
+        | auth.CheckRecoveryPassword
         | account.RegisterDevice
         | account.UnregisterDevice
         | account.UpdateNotifySettings
@@ -15070,6 +15303,8 @@ export namespace Api {
         | account.GetGlobalPrivacySettings
         | account.SetGlobalPrivacySettings
         | account.ReportProfilePhoto
+        | account.ResetPassword
+        | account.DeclinePasswordReset
         | users.GetUsers
         | users.GetFullUser
         | users.SetSecureValueErrors
@@ -15311,6 +15546,8 @@ export namespace Api {
         | bots.SendCustomRequest
         | bots.AnswerWebhookJSONQuery
         | bots.SetBotCommands
+        | bots.ResetBotCommands
+        | bots.GetBotCommands
         | payments.GetPaymentForm
         | payments.GetPaymentReceipt
         | payments.ValidateRequestedInfo
@@ -15323,6 +15560,8 @@ export namespace Api {
         | stickers.ChangeStickerPosition
         | stickers.AddStickerToSet
         | stickers.SetStickerSetThumb
+        | stickers.CheckShortName
+        | stickers.SuggestShortName
         | phone.GetCallConfig
         | phone.RequestCall
         | phone.AcceptCall
@@ -15349,6 +15588,8 @@ export namespace Api {
         | phone.ToggleGroupCallStartSubscription
         | phone.StartScheduledGroupCall
         | phone.SaveDefaultGroupCallJoinAs
+        | phone.JoinGroupCallPresentation
+        | phone.LeaveGroupCallPresentation
         | langpack.GetLangPack
         | langpack.GetStrings
         | langpack.GetDifference

+ 15 - 4
gramjs/tl/api.js

@@ -112,7 +112,7 @@ function extractParams(fileContent) {
     return [constructors, functions];
 }
 
-function argToBytes(x, type, argName) {
+function argToBytes(x, type, argName, requestName) {
     switch (type) {
         case "int":
             const i = Buffer.alloc(4);
@@ -142,7 +142,9 @@ function argToBytes(x, type, argName) {
             return serializeDate(x);
         default:
             if (x === undefined || typeof x.getBytes !== "function") {
-                throw new Error(`Required object ${argName} is undefined`);
+                throw new Error(
+                    `Required object ${argName} of ${requestName} is undefined`
+                );
             }
             return x.getBytes();
     }
@@ -437,7 +439,11 @@ function createClasses(classesType, params) {
                                 l,
                                 Buffer.concat(
                                     this[arg].map((x) =>
-                                        argToBytes(x, argsConfig[arg].type, arg)
+                                        argToBytes(
+                                            x,
+                                            argsConfig[arg].type,
+                                            fullName
+                                        )
                                     )
                                 )
                             );
@@ -468,7 +474,12 @@ function createClasses(classesType, params) {
                             }
                         } else {
                             buffers.push(
-                                argToBytes(this[arg], argsConfig[arg].type, arg)
+                                argToBytes(
+                                    this[arg],
+                                    argsConfig[arg].type,
+                                    arg,
+                                    fullName
+                                )
                             );
 
                             if (

+ 49 - 19
gramjs/tl/static/api.tl

@@ -1,3 +1,4 @@
+
 ///////////////////////////////
 /////////////////// Layer cons
 ///////////////////////////////
@@ -68,7 +69,7 @@ inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string pro
 inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
 inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
 inputMediaGame#d33f43f3 id:InputGame = InputMedia;
-inputMediaInvoice#f4e096c3 flags:# multiple_allowed:flags.1?true can_forward:flags.2?true title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
+inputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;
 inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;
 inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
 inputMediaDice#e66fbf7b emoticon:string = InputMedia;
@@ -223,7 +224,7 @@ peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bo
 peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;
 
 wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
-wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
+wallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
 
 inputReportReasonSpam#58dbcab8 = ReportReason;
 inputReportReasonViolence#1e22c78d = ReportReason;
@@ -356,7 +357,7 @@ updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
 updateTheme#8216fba3 theme:Theme = Update;
 updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
 updateLoginToken#564fe691 = Update;
-updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector<bytes> = Update;
+updateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector<bytes> qts:int = Update;
 updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
 updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
 updateDialogFilters#3504914f = Update;
@@ -375,6 +376,8 @@ updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
 updateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
 updateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
 updateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;
+updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
+updateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector<BotCommand> = Update;
 
 updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
 
@@ -405,7 +408,7 @@ config#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:fla
 
 nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
 
-help.appUpdate#1da7158f flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string = help.AppUpdate;
+help.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;
 help.noAppUpdate#c45a6536 = help.AppUpdate;
 
 help.inviteText#18cb9f78 message:string = help.InviteText;
@@ -533,7 +536,7 @@ authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true pa
 
 account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
 
-account.password#ad2641f8 flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes = account.Password;
+account.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;
 
 account.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;
 
@@ -578,8 +581,8 @@ keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = Keybo
 keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
 
 replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;
-replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup;
-replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup;
+replyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;
+replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup;
 replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;
 
 messageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;
@@ -649,7 +652,7 @@ inputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:f
 inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
 inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
 inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
-inputBotInlineMessageMediaInvoice#d5348d85 flags:# multiple_allowed:flags.1?true can_forward:flags.3?true title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+inputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
 
 inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
 inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
@@ -1069,14 +1072,14 @@ chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags
 
 inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;
 inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
-inputWallPaperNoFile#8427bbac = InputWallPaper;
+inputWallPaperNoFile#967a462e id:long = InputWallPaper;
 
 account.wallPapersNotModified#1c199183 = account.WallPapers;
 account.wallPapers#702b65a9 hash:int wallpapers:Vector<WallPaper> = account.WallPapers;
 
 codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
 
-wallPaperSettings#5086cf8 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
+wallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
 
 autoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;
 
@@ -1204,11 +1207,11 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
 stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
 
 groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
-groupCall#c95c6654 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true id:long access_hash:long participants_count:int params:flags.0?DataJSON title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int version:int = GroupCall;
+groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
 
 inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
 
-groupCallParticipant#b96b25ee flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long params:flags.6?DataJSON = GroupCallParticipant;
+groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
 
 phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
 
@@ -1245,6 +1248,24 @@ phone.joinAsPeers#afe5623f peers:Vector<Peer> chats:Vector<Chat> users:Vector<Us
 
 phone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;
 
+groupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector<int> = GroupCallParticipantVideoSourceGroup;
+
+groupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector<GroupCallParticipantVideoSourceGroup> audio_source:flags.1?int = GroupCallParticipantVideo;
+
+stickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;
+
+botCommandScopeDefault#2f6cb2ab = BotCommandScope;
+botCommandScopeUsers#3c4f04d8 = BotCommandScope;
+botCommandScopeChats#6fe1a881 = BotCommandScope;
+botCommandScopeChatAdmins#b9aa606a = BotCommandScope;
+botCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;
+botCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;
+botCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;
+
+account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;
+account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
+account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
+
 ---functions---
 
 invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -1266,13 +1287,14 @@ auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int en
 auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
 auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;
 auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
-auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
+auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.PasswordInputSettings = auth.Authorization;
 auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;
 auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
 auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
 auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector<int> = auth.LoginToken;
 auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
 auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
+auth.checkRecoveryPassword#d36bf79 code:string = Bool;
 
 account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<int> = Bool;
 account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector<int> = Bool;
@@ -1342,6 +1364,8 @@ account.getMultiWallPapers#65ad71dc wallpapers:Vector<InputWallPaper> = Vector<W
 account.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;
 account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;
 account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;
+account.resetPassword#9308ce1b = account.ResetPasswordResult;
+account.declinePasswordReset#4c9409f6 = Bool;
 
 users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
 users.getFullUser#ca30a5b1 id:InputUser = UserFull;
@@ -1591,7 +1615,9 @@ channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
 
 bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
 bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
-bots.setBotCommands#805d46f6 commands:Vector<BotCommand> = Bool;
+bots.setBotCommands#517165a scope:BotCommandScope lang_code:string commands:Vector<BotCommand> = Bool;
+bots.resetBotCommands#3d8de0f9 scope:BotCommandScope lang_code:string = Bool;
+bots.getBotCommands#e34c0dd6 scope:BotCommandScope lang_code:string = Vector<BotCommand>;
 
 payments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;
 payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
@@ -1601,11 +1627,13 @@ payments.getSavedInfo#227d824b = payments.SavedInfo;
 payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
 payments.getBankCardData#2e79d779 number:string = payments.BankCardData;
 
-stickers.createStickerSet#f1036780 flags:# masks:flags.0?true animated:flags.1?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> = messages.StickerSet;
+stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
 stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
 stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet;
 stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet;
 stickers.setStickerSetThumb#9a364e30 stickerset:InputStickerSet thumb:InputDocument = messages.StickerSet;
+stickers.checkShortName#284b3639 short_name:string = Bool;
+stickers.suggestShortName#4dafc503 title:string = stickers.SuggestedShortName;
 
 phone.getCallConfig#55451fa9 = DataJSON;
 phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
@@ -1617,22 +1645,24 @@ phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhon
 phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;
 phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
 phone.createGroupCall#48cdc6d8 flags:# peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
-phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
+phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
 phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
 phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates;
 phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
 phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
 phone.getGroupCall#c7cb017 call:InputGroupCall = phone.GroupCall;
 phone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector<InputPeer> sources:Vector<int> offset:string limit:int = phone.GroupParticipants;
-phone.checkGroupCall#b74a7bea call:InputGroupCall source:int = Bool;
+phone.checkGroupCall#b59cf977 call:InputGroupCall sources:Vector<int> = Vector<int>;
 phone.toggleGroupCallRecord#c02a66d7 flags:# start:flags.0?true call:InputGroupCall title:flags.1?string = Updates;
-phone.editGroupCallParticipant#d975eb80 flags:# muted:flags.0?true call:InputGroupCall participant:InputPeer volume:flags.1?int raise_hand:flags.2?Bool = Updates;
+phone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;
 phone.editGroupCallTitle#1ca6ac0a call:InputGroupCall title:string = Updates;
 phone.getGroupCallJoinAs#ef7c213a peer:InputPeer = phone.JoinAsPeers;
 phone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;
 phone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;
 phone.startScheduledGroupCall#5680e342 call:InputGroupCall = Updates;
 phone.saveDefaultGroupCallJoinAs#575e1f8c peer:InputPeer join_as:InputPeer = Bool;
+phone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;
+phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
 
 langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
 langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
@@ -1649,4 +1679,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel
 stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
 stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
 
-// LAYER 128
+// LAYER 131

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "telegram",
-  "version": "1.7.13",
+  "version": "1.7.18",
   "description": "NodeJS MTProto API Telegram client library,",
   "main": "index.js",
   "types": "index.d.ts",