diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index a5f464968b..6db6db634b 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -610,6 +610,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1281329567] = { return Api.MessageAction.parse_messageActionGroupCallScheduled($0) } dict[-1615153660] = { return Api.MessageAction.parse_messageActionHistoryClear($0) } dict[1345295095] = { return Api.MessageAction.parse_messageActionInviteToGroupCall($0) } + dict[375414334] = { return Api.MessageAction.parse_messageActionManagedBotCreated($0) } dict[-1333866363] = { return Api.MessageAction.parse_messageActionNewCreatorPending($0) } dict[1042781114] = { return Api.MessageAction.parse_messageActionNoForwardsRequest($0) } dict[-1082301070] = { return Api.MessageAction.parse_messageActionNoForwardsToggle($0) } @@ -898,6 +899,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1917633461] = { return Api.ReportResult.parse_reportResultReported($0) } dict[865857388] = { return Api.RequestPeerType.parse_requestPeerTypeBroadcast($0) } dict[-906990053] = { return Api.RequestPeerType.parse_requestPeerTypeChat($0) } + dict[1048699000] = { return Api.RequestPeerType.parse_requestPeerTypeCreateBot($0) } dict[1597737472] = { return Api.RequestPeerType.parse_requestPeerTypeUser($0) } dict[-1952185372] = { return Api.RequestedPeer.parse_requestedPeerChannel($0) } dict[1929860175] = { return Api.RequestedPeer.parse_requestedPeerChat($0) } @@ -1353,6 +1355,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1012971041] = { return Api.bots.ExportedBotToken.parse_exportedBotToken($0) } dict[428978491] = { return Api.bots.PopularAppBots.parse_popularAppBots($0) } dict[212278628] = { return Api.bots.PreviewInfo.parse_previewInfo($0) } + dict[569994407] = { return Api.bots.RequestedButton.parse_requestedButton($0) } dict[-309659827] = { return Api.channels.AdminLogResults.parse_adminLogResults($0) } dict[-541588713] = { return Api.channels.ChannelParticipant.parse_channelParticipant($0) } dict[-1699676497] = { return Api.channels.ChannelParticipants.parse_channelParticipants($0) } @@ -2486,6 +2489,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.bots.PreviewInfo: _1.serialize(buffer, boxed) + case let _1 as Api.bots.RequestedButton: + _1.serialize(buffer, boxed) case let _1 as Api.channels.AdminLogResults: _1.serialize(buffer, boxed) case let _1 as Api.channels.ChannelParticipant: diff --git a/submodules/TelegramApi/Sources/Api15.swift b/submodules/TelegramApi/Sources/Api15.swift index 32cb3b7453..aed2162013 100644 --- a/submodules/TelegramApi/Sources/Api15.swift +++ b/submodules/TelegramApi/Sources/Api15.swift @@ -1933,6 +1933,15 @@ public extension Api { return ("messageActionInviteToGroupCall", [("call", self.call as Any), ("users", self.users as Any)]) } } + public class Cons_messageActionManagedBotCreated: TypeConstructorDescription { + public var botId: Int64 + public init(botId: Int64) { + self.botId = botId + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("messageActionManagedBotCreated", [("botId", self.botId as Any)]) + } + } public class Cons_messageActionNewCreatorPending: TypeConstructorDescription { public var newCreatorId: Int64 public init(newCreatorId: Int64) { @@ -2399,6 +2408,7 @@ public extension Api { case messageActionGroupCallScheduled(Cons_messageActionGroupCallScheduled) case messageActionHistoryClear case messageActionInviteToGroupCall(Cons_messageActionInviteToGroupCall) + case messageActionManagedBotCreated(Cons_messageActionManagedBotCreated) case messageActionNewCreatorPending(Cons_messageActionNewCreatorPending) case messageActionNoForwardsRequest(Cons_messageActionNoForwardsRequest) case messageActionNoForwardsToggle(Cons_messageActionNoForwardsToggle) @@ -2707,6 +2717,12 @@ public extension Api { serializeInt64(item, buffer: buffer, boxed: false) } break + case .messageActionManagedBotCreated(let _data): + if boxed { + buffer.appendInt32(375414334) + } + serializeInt64(_data.botId, buffer: buffer, boxed: false) + break case .messageActionNewCreatorPending(let _data): if boxed { buffer.appendInt32(-1333866363) @@ -3152,6 +3168,8 @@ public extension Api { return ("messageActionHistoryClear", []) case .messageActionInviteToGroupCall(let _data): return ("messageActionInviteToGroupCall", [("call", _data.call as Any), ("users", _data.users as Any)]) + case .messageActionManagedBotCreated(let _data): + return ("messageActionManagedBotCreated", [("botId", _data.botId as Any)]) case .messageActionNewCreatorPending(let _data): return ("messageActionNewCreatorPending", [("newCreatorId", _data.newCreatorId as Any)]) case .messageActionNoForwardsRequest(let _data): @@ -3705,6 +3723,17 @@ public extension Api { return nil } } + public static func parse_messageActionManagedBotCreated(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionManagedBotCreated(Cons_messageActionManagedBotCreated(botId: _1!)) + } + else { + return nil + } + } public static func parse_messageActionNewCreatorPending(_ reader: BufferReader) -> MessageAction? { var _1: Int64? _1 = reader.readInt64() diff --git a/submodules/TelegramApi/Sources/Api22.swift b/submodules/TelegramApi/Sources/Api22.swift index 5f137e18de..6aee72ae30 100644 --- a/submodules/TelegramApi/Sources/Api22.swift +++ b/submodules/TelegramApi/Sources/Api22.swift @@ -720,6 +720,19 @@ public extension Api { return ("requestPeerTypeChat", [("flags", self.flags as Any), ("hasUsername", self.hasUsername as Any), ("forum", self.forum as Any), ("userAdminRights", self.userAdminRights as Any), ("botAdminRights", self.botAdminRights as Any)]) } } + public class Cons_requestPeerTypeCreateBot: TypeConstructorDescription { + public var flags: Int32 + public var suggestedName: String? + public var suggestedUsername: String? + public init(flags: Int32, suggestedName: String?, suggestedUsername: String?) { + self.flags = flags + self.suggestedName = suggestedName + self.suggestedUsername = suggestedUsername + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("requestPeerTypeCreateBot", [("flags", self.flags as Any), ("suggestedName", self.suggestedName as Any), ("suggestedUsername", self.suggestedUsername as Any)]) + } + } public class Cons_requestPeerTypeUser: TypeConstructorDescription { public var flags: Int32 public var bot: Api.Bool? @@ -735,6 +748,7 @@ public extension Api { } case requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast) case requestPeerTypeChat(Cons_requestPeerTypeChat) + case requestPeerTypeCreateBot(Cons_requestPeerTypeCreateBot) case requestPeerTypeUser(Cons_requestPeerTypeUser) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { @@ -772,6 +786,18 @@ public extension Api { _data.botAdminRights!.serialize(buffer, true) } break + case .requestPeerTypeCreateBot(let _data): + if boxed { + buffer.appendInt32(1048699000) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.suggestedName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.suggestedUsername!, buffer: buffer, boxed: false) + } + break case .requestPeerTypeUser(let _data): if boxed { buffer.appendInt32(1597737472) @@ -793,6 +819,8 @@ public extension Api { return ("requestPeerTypeBroadcast", [("flags", _data.flags as Any), ("hasUsername", _data.hasUsername as Any), ("userAdminRights", _data.userAdminRights as Any), ("botAdminRights", _data.botAdminRights as Any)]) case .requestPeerTypeChat(let _data): return ("requestPeerTypeChat", [("flags", _data.flags as Any), ("hasUsername", _data.hasUsername as Any), ("forum", _data.forum as Any), ("userAdminRights", _data.userAdminRights as Any), ("botAdminRights", _data.botAdminRights as Any)]) + case .requestPeerTypeCreateBot(let _data): + return ("requestPeerTypeCreateBot", [("flags", _data.flags as Any), ("suggestedName", _data.suggestedName as Any), ("suggestedUsername", _data.suggestedUsername as Any)]) case .requestPeerTypeUser(let _data): return ("requestPeerTypeUser", [("flags", _data.flags as Any), ("bot", _data.bot as Any), ("premium", _data.premium as Any)]) } @@ -869,6 +897,27 @@ public extension Api { return nil } } + public static func parse_requestPeerTypeCreateBot(_ reader: BufferReader) -> RequestPeerType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1!) & Int(1 << 1) != 0 { + _2 = parseString(reader) + } + var _3: String? + if Int(_1!) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.RequestPeerType.requestPeerTypeCreateBot(Cons_requestPeerTypeCreateBot(flags: _1!, suggestedName: _2, suggestedUsername: _3)) + } + else { + return nil + } + } public static func parse_requestPeerTypeUser(_ reader: BufferReader) -> RequestPeerType? { var _1: Int32? _1 = reader.readInt32() diff --git a/submodules/TelegramApi/Sources/Api32.swift b/submodules/TelegramApi/Sources/Api32.swift index caa44c463d..f2621554cf 100644 --- a/submodules/TelegramApi/Sources/Api32.swift +++ b/submodules/TelegramApi/Sources/Api32.swift @@ -226,6 +226,50 @@ public extension Api.bots { } } } +public extension Api.bots { + enum RequestedButton: TypeConstructorDescription { + public class Cons_requestedButton: TypeConstructorDescription { + public var requestId: String + public init(requestId: String) { + self.requestId = requestId + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("requestedButton", [("requestId", self.requestId as Any)]) + } + } + case requestedButton(Cons_requestedButton) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .requestedButton(let _data): + if boxed { + buffer.appendInt32(569994407) + } + serializeString(_data.requestId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .requestedButton(let _data): + return ("requestedButton", [("requestId", _data.requestId as Any)]) + } + } + + public static func parse_requestedButton(_ reader: BufferReader) -> RequestedButton? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.bots.RequestedButton.requestedButton(Cons_requestedButton(requestId: _1!)) + } + else { + return nil + } + } + } +} public extension Api.channels { enum AdminLogResults: TypeConstructorDescription { public class Cons_adminLogResults: TypeConstructorDescription { @@ -1767,66 +1811,3 @@ public extension Api.fragment { } } } -public extension Api.help { - enum AppConfig: TypeConstructorDescription { - public class Cons_appConfig: TypeConstructorDescription { - public var hash: Int32 - public var config: Api.JSONValue - public init(hash: Int32, config: Api.JSONValue) { - self.hash = hash - self.config = config - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("appConfig", [("hash", self.hash as Any), ("config", self.config as Any)]) - } - } - case appConfig(Cons_appConfig) - case appConfigNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .appConfig(let _data): - if boxed { - buffer.appendInt32(-585598930) - } - serializeInt32(_data.hash, buffer: buffer, boxed: false) - _data.config.serialize(buffer, true) - break - case .appConfigNotModified: - if boxed { - buffer.appendInt32(2094949405) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .appConfig(let _data): - return ("appConfig", [("hash", _data.hash as Any), ("config", _data.config as Any)]) - case .appConfigNotModified: - return ("appConfigNotModified", []) - } - } - - public static func parse_appConfig(_ reader: BufferReader) -> AppConfig? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.JSONValue? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.JSONValue - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.help.AppConfig.appConfig(Cons_appConfig(hash: _1!, config: _2!)) - } - else { - return nil - } - } - public static func parse_appConfigNotModified(_ reader: BufferReader) -> AppConfig? { - return Api.help.AppConfig.appConfigNotModified - } - } -} diff --git a/submodules/TelegramApi/Sources/Api33.swift b/submodules/TelegramApi/Sources/Api33.swift index 21c5351806..7d5929f9b7 100644 --- a/submodules/TelegramApi/Sources/Api33.swift +++ b/submodules/TelegramApi/Sources/Api33.swift @@ -1,3 +1,66 @@ +public extension Api.help { + enum AppConfig: TypeConstructorDescription { + public class Cons_appConfig: TypeConstructorDescription { + public var hash: Int32 + public var config: Api.JSONValue + public init(hash: Int32, config: Api.JSONValue) { + self.hash = hash + self.config = config + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("appConfig", [("hash", self.hash as Any), ("config", self.config as Any)]) + } + } + case appConfig(Cons_appConfig) + case appConfigNotModified + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .appConfig(let _data): + if boxed { + buffer.appendInt32(-585598930) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + _data.config.serialize(buffer, true) + break + case .appConfigNotModified: + if boxed { + buffer.appendInt32(2094949405) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .appConfig(let _data): + return ("appConfig", [("hash", _data.hash as Any), ("config", _data.config as Any)]) + case .appConfigNotModified: + return ("appConfigNotModified", []) + } + } + + public static func parse_appConfig(_ reader: BufferReader) -> AppConfig? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.JSONValue? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.JSONValue + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.AppConfig.appConfig(Cons_appConfig(hash: _1!, config: _2!)) + } + else { + return nil + } + } + public static func parse_appConfigNotModified(_ reader: BufferReader) -> AppConfig? { + return Api.help.AppConfig.appConfigNotModified + } + } +} public extension Api.help { enum AppUpdate: TypeConstructorDescription { public class Cons_appUpdate: TypeConstructorDescription { @@ -1618,109 +1681,3 @@ public extension Api.messages { } } } -public extension Api.messages { - enum AffectedHistory: TypeConstructorDescription { - public class Cons_affectedHistory: TypeConstructorDescription { - public var pts: Int32 - public var ptsCount: Int32 - public var offset: Int32 - public init(pts: Int32, ptsCount: Int32, offset: Int32) { - self.pts = pts - self.ptsCount = ptsCount - self.offset = offset - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("affectedHistory", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("offset", self.offset as Any)]) - } - } - case affectedHistory(Cons_affectedHistory) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .affectedHistory(let _data): - if boxed { - buffer.appendInt32(-1269012015) - } - serializeInt32(_data.pts, buffer: buffer, boxed: false) - serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) - serializeInt32(_data.offset, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .affectedHistory(let _data): - return ("affectedHistory", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("offset", _data.offset as Any)]) - } - } - - public static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.AffectedHistory.affectedHistory(Cons_affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum AffectedMessages: TypeConstructorDescription { - public class Cons_affectedMessages: TypeConstructorDescription { - public var pts: Int32 - public var ptsCount: Int32 - public init(pts: Int32, ptsCount: Int32) { - self.pts = pts - self.ptsCount = ptsCount - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("affectedMessages", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) - } - } - case affectedMessages(Cons_affectedMessages) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .affectedMessages(let _data): - if boxed { - buffer.appendInt32(-2066640507) - } - serializeInt32(_data.pts, buffer: buffer, boxed: false) - serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .affectedMessages(let _data): - return ("affectedMessages", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) - } - } - - public static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.AffectedMessages.affectedMessages(Cons_affectedMessages(pts: _1!, ptsCount: _2!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api34.swift b/submodules/TelegramApi/Sources/Api34.swift index d51f39fcbe..c59592deab 100644 --- a/submodules/TelegramApi/Sources/Api34.swift +++ b/submodules/TelegramApi/Sources/Api34.swift @@ -1,3 +1,109 @@ +public extension Api.messages { + enum AffectedHistory: TypeConstructorDescription { + public class Cons_affectedHistory: TypeConstructorDescription { + public var pts: Int32 + public var ptsCount: Int32 + public var offset: Int32 + public init(pts: Int32, ptsCount: Int32, offset: Int32) { + self.pts = pts + self.ptsCount = ptsCount + self.offset = offset + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("affectedHistory", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("offset", self.offset as Any)]) + } + } + case affectedHistory(Cons_affectedHistory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .affectedHistory(let _data): + if boxed { + buffer.appendInt32(-1269012015) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + serializeInt32(_data.offset, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .affectedHistory(let _data): + return ("affectedHistory", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("offset", _data.offset as Any)]) + } + } + + public static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.AffectedHistory.affectedHistory(Cons_affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum AffectedMessages: TypeConstructorDescription { + public class Cons_affectedMessages: TypeConstructorDescription { + public var pts: Int32 + public var ptsCount: Int32 + public init(pts: Int32, ptsCount: Int32) { + self.pts = pts + self.ptsCount = ptsCount + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("affectedMessages", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + } + } + case affectedMessages(Cons_affectedMessages) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .affectedMessages(let _data): + if boxed { + buffer.appendInt32(-2066640507) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .affectedMessages(let _data): + return ("affectedMessages", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + } + } + + public static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.AffectedMessages.affectedMessages(Cons_affectedMessages(pts: _1!, ptsCount: _2!)) + } + else { + return nil + } + } + } +} public extension Api.messages { enum AllStickers: TypeConstructorDescription { public class Cons_allStickers: TypeConstructorDescription { @@ -1670,71 +1776,3 @@ public extension Api.messages { } } } -public extension Api.messages { - enum ExportedChatInvites: TypeConstructorDescription { - public class Cons_exportedChatInvites: TypeConstructorDescription { - public var count: Int32 - public var invites: [Api.ExportedChatInvite] - public var users: [Api.User] - public init(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User]) { - self.count = count - self.invites = invites - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedChatInvites", [("count", self.count as Any), ("invites", self.invites as Any), ("users", self.users as Any)]) - } - } - case exportedChatInvites(Cons_exportedChatInvites) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedChatInvites(let _data): - if boxed { - buffer.appendInt32(-1111085620) - } - serializeInt32(_data.count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.invites.count)) - for item in _data.invites { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedChatInvites(let _data): - return ("exportedChatInvites", [("count", _data.count as Any), ("invites", _data.invites as Any), ("users", _data.users as Any)]) - } - } - - public static func parse_exportedChatInvites(_ reader: BufferReader) -> ExportedChatInvites? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.ExportedChatInvite]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ExportedChatInvite.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.ExportedChatInvites.exportedChatInvites(Cons_exportedChatInvites(count: _1!, invites: _2!, users: _3!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api35.swift b/submodules/TelegramApi/Sources/Api35.swift index 82443de740..e762a696ee 100644 --- a/submodules/TelegramApi/Sources/Api35.swift +++ b/submodules/TelegramApi/Sources/Api35.swift @@ -1,3 +1,71 @@ +public extension Api.messages { + enum ExportedChatInvites: TypeConstructorDescription { + public class Cons_exportedChatInvites: TypeConstructorDescription { + public var count: Int32 + public var invites: [Api.ExportedChatInvite] + public var users: [Api.User] + public init(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User]) { + self.count = count + self.invites = invites + self.users = users + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("exportedChatInvites", [("count", self.count as Any), ("invites", self.invites as Any), ("users", self.users as Any)]) + } + } + case exportedChatInvites(Cons_exportedChatInvites) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedChatInvites(let _data): + if boxed { + buffer.appendInt32(-1111085620) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.invites.count)) + for item in _data.invites { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedChatInvites(let _data): + return ("exportedChatInvites", [("count", _data.count as Any), ("invites", _data.invites as Any), ("users", _data.users as Any)]) + } + } + + public static func parse_exportedChatInvites(_ reader: BufferReader) -> ExportedChatInvites? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.ExportedChatInvite]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ExportedChatInvite.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.ExportedChatInvites.exportedChatInvites(Cons_exportedChatInvites(count: _1!, invites: _2!, users: _3!)) + } + else { + return nil + } + } + } +} public extension Api.messages { enum FavedStickers: TypeConstructorDescription { public class Cons_favedStickers: TypeConstructorDescription { @@ -1860,195 +1928,3 @@ public extension Api.messages { } } } -public extension Api.messages { - enum SavedDialogs: TypeConstructorDescription { - public class Cons_savedDialogs: TypeConstructorDescription { - public var dialogs: [Api.SavedDialog] - public var messages: [Api.Message] - public var chats: [Api.Chat] - public var users: [Api.User] - public init(dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { - self.dialogs = dialogs - self.messages = messages - self.chats = chats - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialogs", [("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) - } - } - public class Cons_savedDialogsNotModified: TypeConstructorDescription { - public var count: Int32 - public init(count: Int32) { - self.count = count - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialogsNotModified", [("count", self.count as Any)]) - } - } - public class Cons_savedDialogsSlice: TypeConstructorDescription { - public var count: Int32 - public var dialogs: [Api.SavedDialog] - public var messages: [Api.Message] - public var chats: [Api.Chat] - public var users: [Api.User] - public init(count: Int32, dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { - self.count = count - self.dialogs = dialogs - self.messages = messages - self.chats = chats - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialogsSlice", [("count", self.count as Any), ("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) - } - } - case savedDialogs(Cons_savedDialogs) - case savedDialogsNotModified(Cons_savedDialogsNotModified) - case savedDialogsSlice(Cons_savedDialogsSlice) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedDialogs(let _data): - if boxed { - buffer.appendInt32(-130358751) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.dialogs.count)) - for item in _data.dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.messages.count)) - for item in _data.messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - case .savedDialogsNotModified(let _data): - if boxed { - buffer.appendInt32(-1071681560) - } - serializeInt32(_data.count, buffer: buffer, boxed: false) - break - case .savedDialogsSlice(let _data): - if boxed { - buffer.appendInt32(1153080793) - } - serializeInt32(_data.count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.dialogs.count)) - for item in _data.dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.messages.count)) - for item in _data.messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedDialogs(let _data): - return ("savedDialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) - case .savedDialogsNotModified(let _data): - return ("savedDialogsNotModified", [("count", _data.count as Any)]) - case .savedDialogsSlice(let _data): - return ("savedDialogsSlice", [("count", _data.count as Any), ("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) - } - } - - public static func parse_savedDialogs(_ reader: BufferReader) -> SavedDialogs? { - var _1: [Api.SavedDialog]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) - } - var _2: [Api.Message]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.SavedDialogs.savedDialogs(Cons_savedDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) - } - else { - return nil - } - } - public static func parse_savedDialogsNotModified(_ reader: BufferReader) -> SavedDialogs? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.messages.SavedDialogs.savedDialogsNotModified(Cons_savedDialogsNotModified(count: _1!)) - } - else { - return nil - } - } - public static func parse_savedDialogsSlice(_ reader: BufferReader) -> SavedDialogs? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.SavedDialog]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) - } - var _3: [Api.Message]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.SavedDialogs.savedDialogsSlice(Cons_savedDialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api36.swift b/submodules/TelegramApi/Sources/Api36.swift index cfcba0b3b9..c377bf69c2 100644 --- a/submodules/TelegramApi/Sources/Api36.swift +++ b/submodules/TelegramApi/Sources/Api36.swift @@ -1,3 +1,195 @@ +public extension Api.messages { + enum SavedDialogs: TypeConstructorDescription { + public class Cons_savedDialogs: TypeConstructorDescription { + public var dialogs: [Api.SavedDialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("savedDialogs", [("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + } + } + public class Cons_savedDialogsNotModified: TypeConstructorDescription { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("savedDialogsNotModified", [("count", self.count as Any)]) + } + } + public class Cons_savedDialogsSlice: TypeConstructorDescription { + public var count: Int32 + public var dialogs: [Api.SavedDialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(count: Int32, dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.count = count + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("savedDialogsSlice", [("count", self.count as Any), ("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + } + } + case savedDialogs(Cons_savedDialogs) + case savedDialogsNotModified(Cons_savedDialogsNotModified) + case savedDialogsSlice(Cons_savedDialogsSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedDialogs(let _data): + if boxed { + buffer.appendInt32(-130358751) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .savedDialogsNotModified(let _data): + if boxed { + buffer.appendInt32(-1071681560) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + case .savedDialogsSlice(let _data): + if boxed { + buffer.appendInt32(1153080793) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedDialogs(let _data): + return ("savedDialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .savedDialogsNotModified(let _data): + return ("savedDialogsNotModified", [("count", _data.count as Any)]) + case .savedDialogsSlice(let _data): + return ("savedDialogsSlice", [("count", _data.count as Any), ("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + + public static func parse_savedDialogs(_ reader: BufferReader) -> SavedDialogs? { + var _1: [Api.SavedDialog]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) + } + var _2: [Api.Message]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.SavedDialogs.savedDialogs(Cons_savedDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) + } + else { + return nil + } + } + public static func parse_savedDialogsNotModified(_ reader: BufferReader) -> SavedDialogs? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.messages.SavedDialogs.savedDialogsNotModified(Cons_savedDialogsNotModified(count: _1!)) + } + else { + return nil + } + } + public static func parse_savedDialogsSlice(_ reader: BufferReader) -> SavedDialogs? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.SavedDialog]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) + } + var _3: [Api.Message]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.messages.SavedDialogs.savedDialogsSlice(Cons_savedDialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!)) + } + else { + return nil + } + } + } +} public extension Api.messages { enum SavedGifs: TypeConstructorDescription { public class Cons_savedGifs: TypeConstructorDescription { @@ -1655,303 +1847,3 @@ public extension Api.payments { } } } -public extension Api.payments { - enum PaymentForm: TypeConstructorDescription { - public class Cons_paymentForm: TypeConstructorDescription { - public var flags: Int32 - public var formId: Int64 - public var botId: Int64 - public var title: String - public var description: String - public var photo: Api.WebDocument? - public var invoice: Api.Invoice - public var providerId: Int64 - public var url: String - public var nativeProvider: String? - public var nativeParams: Api.DataJSON? - public var additionalMethods: [Api.PaymentFormMethod]? - public var savedInfo: Api.PaymentRequestedInfo? - public var savedCredentials: [Api.PaymentSavedCredentials]? - public var users: [Api.User] - public init(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, providerId: Int64, url: String, nativeProvider: String?, nativeParams: Api.DataJSON?, additionalMethods: [Api.PaymentFormMethod]?, savedInfo: Api.PaymentRequestedInfo?, savedCredentials: [Api.PaymentSavedCredentials]?, users: [Api.User]) { - self.flags = flags - self.formId = formId - self.botId = botId - self.title = title - self.description = description - self.photo = photo - self.invoice = invoice - self.providerId = providerId - self.url = url - self.nativeProvider = nativeProvider - self.nativeParams = nativeParams - self.additionalMethods = additionalMethods - self.savedInfo = savedInfo - self.savedCredentials = savedCredentials - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentForm", [("flags", self.flags as Any), ("formId", self.formId as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("providerId", self.providerId as Any), ("url", self.url as Any), ("nativeProvider", self.nativeProvider as Any), ("nativeParams", self.nativeParams as Any), ("additionalMethods", self.additionalMethods as Any), ("savedInfo", self.savedInfo as Any), ("savedCredentials", self.savedCredentials as Any), ("users", self.users as Any)]) - } - } - public class Cons_paymentFormStarGift: TypeConstructorDescription { - public var formId: Int64 - public var invoice: Api.Invoice - public init(formId: Int64, invoice: Api.Invoice) { - self.formId = formId - self.invoice = invoice - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentFormStarGift", [("formId", self.formId as Any), ("invoice", self.invoice as Any)]) - } - } - public class Cons_paymentFormStars: TypeConstructorDescription { - public var flags: Int32 - public var formId: Int64 - public var botId: Int64 - public var title: String - public var description: String - public var photo: Api.WebDocument? - public var invoice: Api.Invoice - public var users: [Api.User] - public init(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, users: [Api.User]) { - self.flags = flags - self.formId = formId - self.botId = botId - self.title = title - self.description = description - self.photo = photo - self.invoice = invoice - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentFormStars", [("flags", self.flags as Any), ("formId", self.formId as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("users", self.users as Any)]) - } - } - case paymentForm(Cons_paymentForm) - case paymentFormStarGift(Cons_paymentFormStarGift) - case paymentFormStars(Cons_paymentFormStars) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentForm(let _data): - if boxed { - buffer.appendInt32(-1610250415) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.formId, buffer: buffer, boxed: false) - serializeInt64(_data.botId, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) - serializeString(_data.description, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 5) != 0 { - _data.photo!.serialize(buffer, true) - } - _data.invoice.serialize(buffer, true) - serializeInt64(_data.providerId, buffer: buffer, boxed: false) - serializeString(_data.url, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 4) != 0 { - serializeString(_data.nativeProvider!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 4) != 0 { - _data.nativeParams!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 6) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.additionalMethods!.count)) - for item in _data.additionalMethods! { - item.serialize(buffer, true) - } - } - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.savedInfo!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.savedCredentials!.count)) - for item in _data.savedCredentials! { - item.serialize(buffer, true) - } - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - case .paymentFormStarGift(let _data): - if boxed { - buffer.appendInt32(-1272590367) - } - serializeInt64(_data.formId, buffer: buffer, boxed: false) - _data.invoice.serialize(buffer, true) - break - case .paymentFormStars(let _data): - if boxed { - buffer.appendInt32(2079764828) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.formId, buffer: buffer, boxed: false) - serializeInt64(_data.botId, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) - serializeString(_data.description, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 5) != 0 { - _data.photo!.serialize(buffer, true) - } - _data.invoice.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentForm(let _data): - return ("paymentForm", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("providerId", _data.providerId as Any), ("url", _data.url as Any), ("nativeProvider", _data.nativeProvider as Any), ("nativeParams", _data.nativeParams as Any), ("additionalMethods", _data.additionalMethods as Any), ("savedInfo", _data.savedInfo as Any), ("savedCredentials", _data.savedCredentials as Any), ("users", _data.users as Any)]) - case .paymentFormStarGift(let _data): - return ("paymentFormStarGift", [("formId", _data.formId as Any), ("invoice", _data.invoice as Any)]) - case .paymentFormStars(let _data): - return ("paymentFormStars", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("users", _data.users as Any)]) - } - } - - public static func parse_paymentForm(_ reader: BufferReader) -> PaymentForm? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Api.WebDocument? - if Int(_1!) & Int(1 << 5) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WebDocument - } - } - var _7: Api.Invoice? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Invoice - } - var _8: Int64? - _8 = reader.readInt64() - var _9: String? - _9 = parseString(reader) - var _10: String? - if Int(_1!) & Int(1 << 4) != 0 { - _10 = parseString(reader) - } - var _11: Api.DataJSON? - if Int(_1!) & Int(1 << 4) != 0 { - if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - } - var _12: [Api.PaymentFormMethod]? - if Int(_1!) & Int(1 << 6) != 0 { - if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentFormMethod.self) - } - } - var _13: Api.PaymentRequestedInfo? - if Int(_1!) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } - } - var _14: [Api.PaymentSavedCredentials]? - if Int(_1!) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentSavedCredentials.self) - } - } - var _15: [Api.User]? - if let _ = reader.readInt32() { - _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1!) & Int(1 << 5) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = (Int(_1!) & Int(1 << 4) == 0) || _10 != nil - let _c11 = (Int(_1!) & Int(1 << 4) == 0) || _11 != nil - let _c12 = (Int(_1!) & Int(1 << 6) == 0) || _12 != nil - let _c13 = (Int(_1!) & Int(1 << 0) == 0) || _13 != nil - let _c14 = (Int(_1!) & Int(1 << 1) == 0) || _14 != nil - let _c15 = _15 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 { - return Api.payments.PaymentForm.paymentForm(Cons_paymentForm(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, providerId: _8!, url: _9!, nativeProvider: _10, nativeParams: _11, additionalMethods: _12, savedInfo: _13, savedCredentials: _14, users: _15!)) - } - else { - return nil - } - } - public static func parse_paymentFormStarGift(_ reader: BufferReader) -> PaymentForm? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.Invoice? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Invoice - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.payments.PaymentForm.paymentFormStarGift(Cons_paymentFormStarGift(formId: _1!, invoice: _2!)) - } - else { - return nil - } - } - public static func parse_paymentFormStars(_ reader: BufferReader) -> PaymentForm? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Api.WebDocument? - if Int(_1!) & Int(1 << 5) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WebDocument - } - } - var _7: Api.Invoice? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Invoice - } - var _8: [Api.User]? - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1!) & Int(1 << 5) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.payments.PaymentForm.paymentFormStars(Cons_paymentFormStars(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, users: _8!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api37.swift b/submodules/TelegramApi/Sources/Api37.swift index e01fe5f375..89cd11eeb8 100644 --- a/submodules/TelegramApi/Sources/Api37.swift +++ b/submodules/TelegramApi/Sources/Api37.swift @@ -1,3 +1,303 @@ +public extension Api.payments { + enum PaymentForm: TypeConstructorDescription { + public class Cons_paymentForm: TypeConstructorDescription { + public var flags: Int32 + public var formId: Int64 + public var botId: Int64 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var invoice: Api.Invoice + public var providerId: Int64 + public var url: String + public var nativeProvider: String? + public var nativeParams: Api.DataJSON? + public var additionalMethods: [Api.PaymentFormMethod]? + public var savedInfo: Api.PaymentRequestedInfo? + public var savedCredentials: [Api.PaymentSavedCredentials]? + public var users: [Api.User] + public init(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, providerId: Int64, url: String, nativeProvider: String?, nativeParams: Api.DataJSON?, additionalMethods: [Api.PaymentFormMethod]?, savedInfo: Api.PaymentRequestedInfo?, savedCredentials: [Api.PaymentSavedCredentials]?, users: [Api.User]) { + self.flags = flags + self.formId = formId + self.botId = botId + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.providerId = providerId + self.url = url + self.nativeProvider = nativeProvider + self.nativeParams = nativeParams + self.additionalMethods = additionalMethods + self.savedInfo = savedInfo + self.savedCredentials = savedCredentials + self.users = users + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("paymentForm", [("flags", self.flags as Any), ("formId", self.formId as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("providerId", self.providerId as Any), ("url", self.url as Any), ("nativeProvider", self.nativeProvider as Any), ("nativeParams", self.nativeParams as Any), ("additionalMethods", self.additionalMethods as Any), ("savedInfo", self.savedInfo as Any), ("savedCredentials", self.savedCredentials as Any), ("users", self.users as Any)]) + } + } + public class Cons_paymentFormStarGift: TypeConstructorDescription { + public var formId: Int64 + public var invoice: Api.Invoice + public init(formId: Int64, invoice: Api.Invoice) { + self.formId = formId + self.invoice = invoice + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("paymentFormStarGift", [("formId", self.formId as Any), ("invoice", self.invoice as Any)]) + } + } + public class Cons_paymentFormStars: TypeConstructorDescription { + public var flags: Int32 + public var formId: Int64 + public var botId: Int64 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var invoice: Api.Invoice + public var users: [Api.User] + public init(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, users: [Api.User]) { + self.flags = flags + self.formId = formId + self.botId = botId + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.users = users + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("paymentFormStars", [("flags", self.flags as Any), ("formId", self.formId as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("users", self.users as Any)]) + } + } + case paymentForm(Cons_paymentForm) + case paymentFormStarGift(Cons_paymentFormStarGift) + case paymentFormStars(Cons_paymentFormStars) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentForm(let _data): + if boxed { + buffer.appendInt32(-1610250415) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.formId, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + serializeInt64(_data.providerId, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.nativeProvider!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.nativeParams!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.additionalMethods!.count)) + for item in _data.additionalMethods! { + item.serialize(buffer, true) + } + } + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.savedInfo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.savedCredentials!.count)) + for item in _data.savedCredentials! { + item.serialize(buffer, true) + } + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .paymentFormStarGift(let _data): + if boxed { + buffer.appendInt32(-1272590367) + } + serializeInt64(_data.formId, buffer: buffer, boxed: false) + _data.invoice.serialize(buffer, true) + break + case .paymentFormStars(let _data): + if boxed { + buffer.appendInt32(2079764828) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.formId, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentForm(let _data): + return ("paymentForm", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("providerId", _data.providerId as Any), ("url", _data.url as Any), ("nativeProvider", _data.nativeProvider as Any), ("nativeParams", _data.nativeParams as Any), ("additionalMethods", _data.additionalMethods as Any), ("savedInfo", _data.savedInfo as Any), ("savedCredentials", _data.savedCredentials as Any), ("users", _data.users as Any)]) + case .paymentFormStarGift(let _data): + return ("paymentFormStarGift", [("formId", _data.formId as Any), ("invoice", _data.invoice as Any)]) + case .paymentFormStars(let _data): + return ("paymentFormStars", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("users", _data.users as Any)]) + } + } + + public static func parse_paymentForm(_ reader: BufferReader) -> PaymentForm? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Api.WebDocument? + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } + var _7: Api.Invoice? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Invoice + } + var _8: Int64? + _8 = reader.readInt64() + var _9: String? + _9 = parseString(reader) + var _10: String? + if Int(_1!) & Int(1 << 4) != 0 { + _10 = parseString(reader) + } + var _11: Api.DataJSON? + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + } + var _12: [Api.PaymentFormMethod]? + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentFormMethod.self) + } + } + var _13: Api.PaymentRequestedInfo? + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } + var _14: [Api.PaymentSavedCredentials]? + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentSavedCredentials.self) + } + } + var _15: [Api.User]? + if let _ = reader.readInt32() { + _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1!) & Int(1 << 5) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = (Int(_1!) & Int(1 << 4) == 0) || _10 != nil + let _c11 = (Int(_1!) & Int(1 << 4) == 0) || _11 != nil + let _c12 = (Int(_1!) & Int(1 << 6) == 0) || _12 != nil + let _c13 = (Int(_1!) & Int(1 << 0) == 0) || _13 != nil + let _c14 = (Int(_1!) & Int(1 << 1) == 0) || _14 != nil + let _c15 = _15 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 { + return Api.payments.PaymentForm.paymentForm(Cons_paymentForm(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, providerId: _8!, url: _9!, nativeProvider: _10, nativeParams: _11, additionalMethods: _12, savedInfo: _13, savedCredentials: _14, users: _15!)) + } + else { + return nil + } + } + public static func parse_paymentFormStarGift(_ reader: BufferReader) -> PaymentForm? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Invoice? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Invoice + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.payments.PaymentForm.paymentFormStarGift(Cons_paymentFormStarGift(formId: _1!, invoice: _2!)) + } + else { + return nil + } + } + public static func parse_paymentFormStars(_ reader: BufferReader) -> PaymentForm? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Api.WebDocument? + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } + var _7: Api.Invoice? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Invoice + } + var _8: [Api.User]? + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1!) & Int(1 << 5) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + return Api.payments.PaymentForm.paymentFormStars(Cons_paymentFormStars(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, users: _8!)) + } + else { + return nil + } + } + } +} public extension Api.payments { enum PaymentReceipt: TypeConstructorDescription { public class Cons_paymentReceipt: TypeConstructorDescription { @@ -2091,195 +2391,3 @@ public extension Api.phone { } } } -public extension Api.phone { - enum GroupCallStreamChannels: TypeConstructorDescription { - public class Cons_groupCallStreamChannels: TypeConstructorDescription { - public var channels: [Api.GroupCallStreamChannel] - public init(channels: [Api.GroupCallStreamChannel]) { - self.channels = channels - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallStreamChannels", [("channels", self.channels as Any)]) - } - } - case groupCallStreamChannels(Cons_groupCallStreamChannels) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallStreamChannels(let _data): - if boxed { - buffer.appendInt32(-790330702) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.channels.count)) - for item in _data.channels { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallStreamChannels(let _data): - return ("groupCallStreamChannels", [("channels", _data.channels as Any)]) - } - } - - public static func parse_groupCallStreamChannels(_ reader: BufferReader) -> GroupCallStreamChannels? { - var _1: [Api.GroupCallStreamChannel]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallStreamChannel.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.phone.GroupCallStreamChannels.groupCallStreamChannels(Cons_groupCallStreamChannels(channels: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum GroupCallStreamRtmpUrl: TypeConstructorDescription { - public class Cons_groupCallStreamRtmpUrl: TypeConstructorDescription { - public var url: String - public var key: String - public init(url: String, key: String) { - self.url = url - self.key = key - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallStreamRtmpUrl", [("url", self.url as Any), ("key", self.key as Any)]) - } - } - case groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallStreamRtmpUrl(let _data): - if boxed { - buffer.appendInt32(767505458) - } - serializeString(_data.url, buffer: buffer, boxed: false) - serializeString(_data.key, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallStreamRtmpUrl(let _data): - return ("groupCallStreamRtmpUrl", [("url", _data.url as Any), ("key", _data.key as Any)]) - } - } - - public static func parse_groupCallStreamRtmpUrl(_ reader: BufferReader) -> GroupCallStreamRtmpUrl? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.phone.GroupCallStreamRtmpUrl.groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl(url: _1!, key: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum GroupParticipants: TypeConstructorDescription { - public class Cons_groupParticipants: TypeConstructorDescription { - public var count: Int32 - public var participants: [Api.GroupCallParticipant] - public var nextOffset: String - public var chats: [Api.Chat] - public var users: [Api.User] - public var version: Int32 - public init(count: Int32, participants: [Api.GroupCallParticipant], nextOffset: String, chats: [Api.Chat], users: [Api.User], version: Int32) { - self.count = count - self.participants = participants - self.nextOffset = nextOffset - self.chats = chats - self.users = users - self.version = version - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupParticipants", [("count", self.count as Any), ("participants", self.participants as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("version", self.version as Any)]) - } - } - case groupParticipants(Cons_groupParticipants) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupParticipants(let _data): - if boxed { - buffer.appendInt32(-193506890) - } - serializeInt32(_data.count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.participants.count)) - for item in _data.participants { - item.serialize(buffer, true) - } - serializeString(_data.nextOffset, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - serializeInt32(_data.version, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupParticipants(let _data): - return ("groupParticipants", [("count", _data.count as Any), ("participants", _data.participants as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("version", _data.version as Any)]) - } - } - - public static func parse_groupParticipants(_ reader: BufferReader) -> GroupParticipants? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.GroupCallParticipant]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) - } - var _3: String? - _3 = parseString(reader) - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.phone.GroupParticipants.groupParticipants(Cons_groupParticipants(count: _1!, participants: _2!, nextOffset: _3!, chats: _4!, users: _5!, version: _6!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api38.swift b/submodules/TelegramApi/Sources/Api38.swift index c927c7b52f..2f70ec327a 100644 --- a/submodules/TelegramApi/Sources/Api38.swift +++ b/submodules/TelegramApi/Sources/Api38.swift @@ -1,3 +1,195 @@ +public extension Api.phone { + enum GroupCallStreamChannels: TypeConstructorDescription { + public class Cons_groupCallStreamChannels: TypeConstructorDescription { + public var channels: [Api.GroupCallStreamChannel] + public init(channels: [Api.GroupCallStreamChannel]) { + self.channels = channels + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("groupCallStreamChannels", [("channels", self.channels as Any)]) + } + } + case groupCallStreamChannels(Cons_groupCallStreamChannels) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallStreamChannels(let _data): + if boxed { + buffer.appendInt32(-790330702) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.channels.count)) + for item in _data.channels { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallStreamChannels(let _data): + return ("groupCallStreamChannels", [("channels", _data.channels as Any)]) + } + } + + public static func parse_groupCallStreamChannels(_ reader: BufferReader) -> GroupCallStreamChannels? { + var _1: [Api.GroupCallStreamChannel]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallStreamChannel.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.phone.GroupCallStreamChannels.groupCallStreamChannels(Cons_groupCallStreamChannels(channels: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum GroupCallStreamRtmpUrl: TypeConstructorDescription { + public class Cons_groupCallStreamRtmpUrl: TypeConstructorDescription { + public var url: String + public var key: String + public init(url: String, key: String) { + self.url = url + self.key = key + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("groupCallStreamRtmpUrl", [("url", self.url as Any), ("key", self.key as Any)]) + } + } + case groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallStreamRtmpUrl(let _data): + if boxed { + buffer.appendInt32(767505458) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.key, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallStreamRtmpUrl(let _data): + return ("groupCallStreamRtmpUrl", [("url", _data.url as Any), ("key", _data.key as Any)]) + } + } + + public static func parse_groupCallStreamRtmpUrl(_ reader: BufferReader) -> GroupCallStreamRtmpUrl? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.phone.GroupCallStreamRtmpUrl.groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl(url: _1!, key: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum GroupParticipants: TypeConstructorDescription { + public class Cons_groupParticipants: TypeConstructorDescription { + public var count: Int32 + public var participants: [Api.GroupCallParticipant] + public var nextOffset: String + public var chats: [Api.Chat] + public var users: [Api.User] + public var version: Int32 + public init(count: Int32, participants: [Api.GroupCallParticipant], nextOffset: String, chats: [Api.Chat], users: [Api.User], version: Int32) { + self.count = count + self.participants = participants + self.nextOffset = nextOffset + self.chats = chats + self.users = users + self.version = version + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("groupParticipants", [("count", self.count as Any), ("participants", self.participants as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("version", self.version as Any)]) + } + } + case groupParticipants(Cons_groupParticipants) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupParticipants(let _data): + if boxed { + buffer.appendInt32(-193506890) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants.count)) + for item in _data.participants { + item.serialize(buffer, true) + } + serializeString(_data.nextOffset, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupParticipants(let _data): + return ("groupParticipants", [("count", _data.count as Any), ("participants", _data.participants as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("version", _data.version as Any)]) + } + } + + public static func parse_groupParticipants(_ reader: BufferReader) -> GroupParticipants? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.GroupCallParticipant]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) + } + var _3: String? + _3 = parseString(reader) + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.phone.GroupParticipants.groupParticipants(Cons_groupParticipants(count: _1!, participants: _2!, nextOffset: _3!, chats: _4!, users: _5!, version: _6!)) + } + else { + return nil + } + } + } +} public extension Api.phone { enum JoinAsPeers: TypeConstructorDescription { public class Cons_joinAsPeers: TypeConstructorDescription { @@ -1724,143 +1916,3 @@ public extension Api.stories { } } } -public extension Api.stories { - enum CanSendStoryCount: TypeConstructorDescription { - public class Cons_canSendStoryCount: TypeConstructorDescription { - public var countRemains: Int32 - public init(countRemains: Int32) { - self.countRemains = countRemains - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("canSendStoryCount", [("countRemains", self.countRemains as Any)]) - } - } - case canSendStoryCount(Cons_canSendStoryCount) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .canSendStoryCount(let _data): - if boxed { - buffer.appendInt32(-1014513586) - } - serializeInt32(_data.countRemains, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .canSendStoryCount(let _data): - return ("canSendStoryCount", [("countRemains", _data.countRemains as Any)]) - } - } - - public static func parse_canSendStoryCount(_ reader: BufferReader) -> CanSendStoryCount? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.stories.CanSendStoryCount.canSendStoryCount(Cons_canSendStoryCount(countRemains: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.stories { - enum FoundStories: TypeConstructorDescription { - public class Cons_foundStories: TypeConstructorDescription { - public var flags: Int32 - public var count: Int32 - public var stories: [Api.FoundStory] - public var nextOffset: String? - public var chats: [Api.Chat] - public var users: [Api.User] - public init(flags: Int32, count: Int32, stories: [Api.FoundStory], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) { - self.flags = flags - self.count = count - self.stories = stories - self.nextOffset = nextOffset - self.chats = chats - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("foundStories", [("flags", self.flags as Any), ("count", self.count as Any), ("stories", self.stories as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) - } - } - case foundStories(Cons_foundStories) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .foundStories(let _data): - if boxed { - buffer.appendInt32(-488736969) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.stories.count)) - for item in _data.stories { - item.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.nextOffset!, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .foundStories(let _data): - return ("foundStories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("stories", _data.stories as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) - } - } - - public static func parse_foundStories(_ reader: BufferReader) -> FoundStories? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.FoundStory]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FoundStory.self) - } - var _4: String? - if Int(_1!) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: [Api.Chat]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stories.FoundStories.foundStories(Cons_foundStories(flags: _1!, count: _2!, stories: _3!, nextOffset: _4, chats: _5!, users: _6!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api39.swift b/submodules/TelegramApi/Sources/Api39.swift index deb218fe7d..ad59c84c8d 100644 --- a/submodules/TelegramApi/Sources/Api39.swift +++ b/submodules/TelegramApi/Sources/Api39.swift @@ -1,3 +1,143 @@ +public extension Api.stories { + enum CanSendStoryCount: TypeConstructorDescription { + public class Cons_canSendStoryCount: TypeConstructorDescription { + public var countRemains: Int32 + public init(countRemains: Int32) { + self.countRemains = countRemains + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("canSendStoryCount", [("countRemains", self.countRemains as Any)]) + } + } + case canSendStoryCount(Cons_canSendStoryCount) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .canSendStoryCount(let _data): + if boxed { + buffer.appendInt32(-1014513586) + } + serializeInt32(_data.countRemains, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .canSendStoryCount(let _data): + return ("canSendStoryCount", [("countRemains", _data.countRemains as Any)]) + } + } + + public static func parse_canSendStoryCount(_ reader: BufferReader) -> CanSendStoryCount? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.stories.CanSendStoryCount.canSendStoryCount(Cons_canSendStoryCount(countRemains: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.stories { + enum FoundStories: TypeConstructorDescription { + public class Cons_foundStories: TypeConstructorDescription { + public var flags: Int32 + public var count: Int32 + public var stories: [Api.FoundStory] + public var nextOffset: String? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, stories: [Api.FoundStory], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.stories = stories + self.nextOffset = nextOffset + self.chats = chats + self.users = users + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("foundStories", [("flags", self.flags as Any), ("count", self.count as Any), ("stories", self.stories as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + } + } + case foundStories(Cons_foundStories) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .foundStories(let _data): + if boxed { + buffer.appendInt32(-488736969) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stories.count)) + for item in _data.stories { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .foundStories(let _data): + return ("foundStories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("stories", _data.stories as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + + public static func parse_foundStories(_ reader: BufferReader) -> FoundStories? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.FoundStory]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FoundStory.self) + } + var _4: String? + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: [Api.Chat]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _6: [Api.User]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.stories.FoundStories.foundStories(Cons_foundStories(flags: _1!, count: _2!, stories: _3!, nextOffset: _4, chats: _5!, users: _6!)) + } + else { + return nil + } + } + } +} public extension Api.stories { enum PeerStories: TypeConstructorDescription { public class Cons_peerStories: TypeConstructorDescription { diff --git a/submodules/TelegramApi/Sources/Api40.swift b/submodules/TelegramApi/Sources/Api40.swift index 2592800c60..8987e9a98c 100644 --- a/submodules/TelegramApi/Sources/Api40.swift +++ b/submodules/TelegramApi/Sources/Api40.swift @@ -2573,13 +2573,14 @@ public extension Api.functions.bots { } } public extension Api.functions.bots { - static func createBot(name: String, username: String, managerId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + static func createBot(flags: Int32, name: String, username: String, managerId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() - buffer.appendInt32(-1656313365) + buffer.appendInt32(-441352405) + serializeInt32(flags, buffer: buffer, boxed: false) serializeString(name, buffer: buffer, boxed: false) serializeString(username, buffer: buffer, boxed: false) managerId.serialize(buffer, true) - return (FunctionDescription(name: "bots.createBot", parameters: [("name", String(describing: name)), ("username", String(describing: username)), ("managerId", String(describing: managerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + return (FunctionDescription(name: "bots.createBot", parameters: [("flags", String(describing: flags)), ("name", String(describing: name)), ("username", String(describing: username)), ("managerId", String(describing: managerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in let reader = BufferReader(buffer) var result: Api.User? if let signature = reader.readInt32() { @@ -2770,6 +2771,22 @@ public extension Api.functions.bots { }) } } +public extension Api.functions.bots { + static func getRequestedWebViewButton(bot: Api.InputUser, requestId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1295431495) + bot.serialize(buffer, true) + serializeString(requestId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.getRequestedWebViewButton", parameters: [("bot", String(describing: bot)), ("requestId", String(describing: requestId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.KeyboardButton? in + let reader = BufferReader(buffer) + var result: Api.KeyboardButton? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.KeyboardButton + } + return result + }) + } +} public extension Api.functions.bots { static func invokeWebViewCustomMethod(bot: Api.InputUser, customMethod: String, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -2828,6 +2845,22 @@ public extension Api.functions.bots { }) } } +public extension Api.functions.bots { + static func requestWebViewButton(userId: Api.InputUser, button: Api.KeyboardButton) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(832742238) + userId.serialize(buffer, true) + button.serialize(buffer, true) + return (FunctionDescription(name: "bots.requestWebViewButton", parameters: [("userId", String(describing: userId)), ("button", String(describing: button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.RequestedButton? in + let reader = BufferReader(buffer) + var result: Api.bots.RequestedButton? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.RequestedButton + } + return result + }) + } +} public extension Api.functions.bots { static func resetBotCommands(scope: Api.BotCommandScope, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -8831,18 +8864,24 @@ public extension Api.functions.messages { } } public extension Api.functions.messages { - static func sendBotRequestedPeer(peer: Api.InputPeer, msgId: Int32, buttonId: Int32, requestedPeers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + static func sendBotRequestedPeer(flags: Int32, peer: Api.InputPeer, msgId: Int32?, requestId: String?, buttonId: Int32, requestedPeers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() - buffer.appendInt32(-1850552224) + buffer.appendInt32(-1662773304) + serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(msgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(requestId!, buffer: buffer, boxed: false) + } serializeInt32(buttonId, buffer: buffer, boxed: false) buffer.appendInt32(481674261) buffer.appendInt32(Int32(requestedPeers.count)) for item in requestedPeers { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.sendBotRequestedPeer", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("requestedPeers", String(describing: requestedPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + return (FunctionDescription(name: "messages.sendBotRequestedPeer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("requestId", String(describing: requestId)), ("buttonId", String(describing: buttonId)), ("requestedPeers", String(describing: requestedPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in let reader = BufferReader(buffer) var result: Api.Updates? if let signature = reader.readInt32() {