diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index 2c355cf32a..733fd5418f 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -422,13 +422,14 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1979852936] = { return Api.InputMedia.parse_inputMediaStory($0) } dict[-1614454818] = { return Api.InputMedia.parse_inputMediaTodo($0) } dict[58495792] = { return Api.InputMedia.parse_inputMediaUploadedDocument($0) } - dict[505969924] = { return Api.InputMedia.parse_inputMediaUploadedPhoto($0) } + dict[2105767386] = { return Api.InputMedia.parse_inputMediaUploadedPhoto($0) } dict[-1052959727] = { return Api.InputMedia.parse_inputMediaVenue($0) } dict[-1038383031] = { return Api.InputMedia.parse_inputMediaWebPage($0) } dict[-1392895362] = { return Api.InputMessage.parse_inputMessageCallbackQuery($0) } dict[-1502174430] = { return Api.InputMessage.parse_inputMessageID($0) } dict[-2037963464] = { return Api.InputMessage.parse_inputMessagePinned($0) } dict[-1160215659] = { return Api.InputMessage.parse_inputMessageReplyTo($0) } + dict[1076577429] = { return Api.InputMessageReadMetric.parse_inputMessageReadMetric($0) } dict[-1311015810] = { return Api.InputNotifyPeer.parse_inputNotifyBroadcasts($0) } dict[1251338318] = { return Api.InputNotifyPeer.parse_inputNotifyChats($0) } dict[1548122514] = { return Api.InputNotifyPeer.parse_inputNotifyForumTopic($0) } @@ -679,7 +680,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-827703647] = { return Api.MessageMedia.parse_messageMediaGiveawayResults($0) } dict[-156940077] = { return Api.MessageMedia.parse_messageMediaInvoice($0) } dict[-1467669359] = { return Api.MessageMedia.parse_messageMediaPaidMedia($0) } - dict[1766936791] = { return Api.MessageMedia.parse_messageMediaPhoto($0) } + dict[-501814429] = { return Api.MessageMedia.parse_messageMediaPhoto($0) } dict[1272375192] = { return Api.MessageMedia.parse_messageMediaPoll($0) } dict[1758159491] = { return Api.MessageMedia.parse_messageMediaStory($0) } dict[-1974226924] = { return Api.MessageMedia.parse_messageMediaToDo($0) } @@ -1958,6 +1959,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.InputMessage: _1.serialize(buffer, boxed) + case let _1 as Api.InputMessageReadMetric: + _1.serialize(buffer, boxed) case let _1 as Api.InputNotifyPeer: _1.serialize(buffer, boxed) case let _1 as Api.InputPasskeyCredential: diff --git a/submodules/TelegramApi/Sources/Api11.swift b/submodules/TelegramApi/Sources/Api11.swift index 6fa8c87a85..cb09eaa874 100644 --- a/submodules/TelegramApi/Sources/Api11.swift +++ b/submodules/TelegramApi/Sources/Api11.swift @@ -243,14 +243,16 @@ public extension Api { public var file: Api.InputFile public var stickers: [Api.InputDocument]? public var ttlSeconds: Int32? - public init(flags: Int32, file: Api.InputFile, stickers: [Api.InputDocument]?, ttlSeconds: Int32?) { + public var video: Api.InputDocument? + public init(flags: Int32, file: Api.InputFile, stickers: [Api.InputDocument]?, ttlSeconds: Int32?, video: Api.InputDocument?) { self.flags = flags self.file = file self.stickers = stickers self.ttlSeconds = ttlSeconds + self.video = video } public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaUploadedPhoto", [("flags", self.flags as Any), ("file", self.file as Any), ("stickers", self.stickers as Any), ("ttlSeconds", self.ttlSeconds as Any)]) + return ("inputMediaUploadedPhoto", [("flags", self.flags as Any), ("file", self.file as Any), ("stickers", self.stickers as Any), ("ttlSeconds", self.ttlSeconds as Any), ("video", self.video as Any)]) } } public class Cons_inputMediaVenue: TypeConstructorDescription { @@ -526,7 +528,7 @@ public extension Api { break case .inputMediaUploadedPhoto(let _data): if boxed { - buffer.appendInt32(505969924) + buffer.appendInt32(2105767386) } serializeInt32(_data.flags, buffer: buffer, boxed: false) _data.file.serialize(buffer, true) @@ -540,6 +542,9 @@ public extension Api { if Int(_data.flags) & Int(1 << 1) != 0 { serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.video!.serialize(buffer, true) + } break case .inputMediaVenue(let _data): if boxed { @@ -599,7 +604,7 @@ public extension Api { case .inputMediaUploadedDocument(let _data): return ("inputMediaUploadedDocument", [("flags", _data.flags as Any), ("file", _data.file as Any), ("thumb", _data.thumb as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any), ("stickers", _data.stickers as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) case .inputMediaUploadedPhoto(let _data): - return ("inputMediaUploadedPhoto", [("flags", _data.flags as Any), ("file", _data.file as Any), ("stickers", _data.stickers as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + return ("inputMediaUploadedPhoto", [("flags", _data.flags as Any), ("file", _data.file as Any), ("stickers", _data.stickers as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("video", _data.video as Any)]) case .inputMediaVenue(let _data): return ("inputMediaVenue", [("geoPoint", _data.geoPoint as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) case .inputMediaWebPage(let _data): @@ -1038,12 +1043,19 @@ public extension Api { if Int(_1!) & Int(1 << 1) != 0 { _4 = reader.readInt32() } + var _5: Api.InputDocument? + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.InputMedia.inputMediaUploadedPhoto(Cons_inputMediaUploadedPhoto(flags: _1!, file: _2!, stickers: _3, ttlSeconds: _4)) + let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.InputMedia.inputMediaUploadedPhoto(Cons_inputMediaUploadedPhoto(flags: _1!, file: _2!, stickers: _3, ttlSeconds: _4, video: _5)) } else { return nil @@ -1212,6 +1224,80 @@ public extension Api { } } } +public extension Api { + enum InputMessageReadMetric: TypeConstructorDescription { + public class Cons_inputMessageReadMetric: TypeConstructorDescription { + public var msgId: Int32 + public var viewId: Int64 + public var timeInViewMs: Int32 + public var activeTimeInViewMs: Int32 + public var heightToViewportRatioPermille: Int32 + public var seenRangeRatioPermille: Int32 + public init(msgId: Int32, viewId: Int64, timeInViewMs: Int32, activeTimeInViewMs: Int32, heightToViewportRatioPermille: Int32, seenRangeRatioPermille: Int32) { + self.msgId = msgId + self.viewId = viewId + self.timeInViewMs = timeInViewMs + self.activeTimeInViewMs = activeTimeInViewMs + self.heightToViewportRatioPermille = heightToViewportRatioPermille + self.seenRangeRatioPermille = seenRangeRatioPermille + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("inputMessageReadMetric", [("msgId", self.msgId as Any), ("viewId", self.viewId as Any), ("timeInViewMs", self.timeInViewMs as Any), ("activeTimeInViewMs", self.activeTimeInViewMs as Any), ("heightToViewportRatioPermille", self.heightToViewportRatioPermille as Any), ("seenRangeRatioPermille", self.seenRangeRatioPermille as Any)]) + } + } + case inputMessageReadMetric(Cons_inputMessageReadMetric) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputMessageReadMetric(let _data): + if boxed { + buffer.appendInt32(1076577429) + } + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.viewId, buffer: buffer, boxed: false) + serializeInt32(_data.timeInViewMs, buffer: buffer, boxed: false) + serializeInt32(_data.activeTimeInViewMs, buffer: buffer, boxed: false) + serializeInt32(_data.heightToViewportRatioPermille, buffer: buffer, boxed: false) + serializeInt32(_data.seenRangeRatioPermille, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputMessageReadMetric(let _data): + return ("inputMessageReadMetric", [("msgId", _data.msgId as Any), ("viewId", _data.viewId as Any), ("timeInViewMs", _data.timeInViewMs as Any), ("activeTimeInViewMs", _data.activeTimeInViewMs as Any), ("heightToViewportRatioPermille", _data.heightToViewportRatioPermille as Any), ("seenRangeRatioPermille", _data.seenRangeRatioPermille as Any)]) + } + } + + public static func parse_inputMessageReadMetric(_ reader: BufferReader) -> InputMessageReadMetric? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + 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.InputMessageReadMetric.inputMessageReadMetric(Cons_inputMessageReadMetric(msgId: _1!, viewId: _2!, timeInViewMs: _3!, activeTimeInViewMs: _4!, heightToViewportRatioPermille: _5!, seenRangeRatioPermille: _6!)) + } + else { + return nil + } + } + } +} public extension Api { indirect enum InputNotifyPeer: TypeConstructorDescription { public class Cons_inputNotifyForumTopic: TypeConstructorDescription { @@ -1415,104 +1501,3 @@ public extension Api { } } } -public extension Api { - enum InputPasskeyResponse: TypeConstructorDescription { - public class Cons_inputPasskeyResponseLogin: TypeConstructorDescription { - public var clientData: Api.DataJSON - public var authenticatorData: Buffer - public var signature: Buffer - public var userHandle: String - public init(clientData: Api.DataJSON, authenticatorData: Buffer, signature: Buffer, userHandle: String) { - self.clientData = clientData - self.authenticatorData = authenticatorData - self.signature = signature - self.userHandle = userHandle - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPasskeyResponseLogin", [("clientData", self.clientData as Any), ("authenticatorData", self.authenticatorData as Any), ("signature", self.signature as Any), ("userHandle", self.userHandle as Any)]) - } - } - public class Cons_inputPasskeyResponseRegister: TypeConstructorDescription { - public var clientData: Api.DataJSON - public var attestationData: Buffer - public init(clientData: Api.DataJSON, attestationData: Buffer) { - self.clientData = clientData - self.attestationData = attestationData - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPasskeyResponseRegister", [("clientData", self.clientData as Any), ("attestationData", self.attestationData as Any)]) - } - } - case inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin) - case inputPasskeyResponseRegister(Cons_inputPasskeyResponseRegister) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPasskeyResponseLogin(let _data): - if boxed { - buffer.appendInt32(-1021329078) - } - _data.clientData.serialize(buffer, true) - serializeBytes(_data.authenticatorData, buffer: buffer, boxed: false) - serializeBytes(_data.signature, buffer: buffer, boxed: false) - serializeString(_data.userHandle, buffer: buffer, boxed: false) - break - case .inputPasskeyResponseRegister(let _data): - if boxed { - buffer.appendInt32(1046713180) - } - _data.clientData.serialize(buffer, true) - serializeBytes(_data.attestationData, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPasskeyResponseLogin(let _data): - return ("inputPasskeyResponseLogin", [("clientData", _data.clientData as Any), ("authenticatorData", _data.authenticatorData as Any), ("signature", _data.signature as Any), ("userHandle", _data.userHandle as Any)]) - case .inputPasskeyResponseRegister(let _data): - return ("inputPasskeyResponseRegister", [("clientData", _data.clientData as Any), ("attestationData", _data.attestationData as Any)]) - } - } - - public static func parse_inputPasskeyResponseLogin(_ reader: BufferReader) -> InputPasskeyResponse? { - var _1: Api.DataJSON? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Buffer? - _3 = parseBytes(reader) - var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.InputPasskeyResponse.inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin(clientData: _1!, authenticatorData: _2!, signature: _3!, userHandle: _4!)) - } - else { - return nil - } - } - public static func parse_inputPasskeyResponseRegister(_ reader: BufferReader) -> InputPasskeyResponse? { - var _1: Api.DataJSON? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.InputPasskeyResponse.inputPasskeyResponseRegister(Cons_inputPasskeyResponseRegister(clientData: _1!, attestationData: _2!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api12.swift b/submodules/TelegramApi/Sources/Api12.swift index 83abe12ea2..9b4bb168b3 100644 --- a/submodules/TelegramApi/Sources/Api12.swift +++ b/submodules/TelegramApi/Sources/Api12.swift @@ -1,3 +1,104 @@ +public extension Api { + enum InputPasskeyResponse: TypeConstructorDescription { + public class Cons_inputPasskeyResponseLogin: TypeConstructorDescription { + public var clientData: Api.DataJSON + public var authenticatorData: Buffer + public var signature: Buffer + public var userHandle: String + public init(clientData: Api.DataJSON, authenticatorData: Buffer, signature: Buffer, userHandle: String) { + self.clientData = clientData + self.authenticatorData = authenticatorData + self.signature = signature + self.userHandle = userHandle + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("inputPasskeyResponseLogin", [("clientData", self.clientData as Any), ("authenticatorData", self.authenticatorData as Any), ("signature", self.signature as Any), ("userHandle", self.userHandle as Any)]) + } + } + public class Cons_inputPasskeyResponseRegister: TypeConstructorDescription { + public var clientData: Api.DataJSON + public var attestationData: Buffer + public init(clientData: Api.DataJSON, attestationData: Buffer) { + self.clientData = clientData + self.attestationData = attestationData + } + public func descriptionFields() -> (String, [(String, Any)]) { + return ("inputPasskeyResponseRegister", [("clientData", self.clientData as Any), ("attestationData", self.attestationData as Any)]) + } + } + case inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin) + case inputPasskeyResponseRegister(Cons_inputPasskeyResponseRegister) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPasskeyResponseLogin(let _data): + if boxed { + buffer.appendInt32(-1021329078) + } + _data.clientData.serialize(buffer, true) + serializeBytes(_data.authenticatorData, buffer: buffer, boxed: false) + serializeBytes(_data.signature, buffer: buffer, boxed: false) + serializeString(_data.userHandle, buffer: buffer, boxed: false) + break + case .inputPasskeyResponseRegister(let _data): + if boxed { + buffer.appendInt32(1046713180) + } + _data.clientData.serialize(buffer, true) + serializeBytes(_data.attestationData, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPasskeyResponseLogin(let _data): + return ("inputPasskeyResponseLogin", [("clientData", _data.clientData as Any), ("authenticatorData", _data.authenticatorData as Any), ("signature", _data.signature as Any), ("userHandle", _data.userHandle as Any)]) + case .inputPasskeyResponseRegister(let _data): + return ("inputPasskeyResponseRegister", [("clientData", _data.clientData as Any), ("attestationData", _data.attestationData as Any)]) + } + } + + public static func parse_inputPasskeyResponseLogin(_ reader: BufferReader) -> InputPasskeyResponse? { + var _1: Api.DataJSON? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Buffer? + _3 = parseBytes(reader) + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.InputPasskeyResponse.inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin(clientData: _1!, authenticatorData: _2!, signature: _3!, userHandle: _4!)) + } + else { + return nil + } + } + public static func parse_inputPasskeyResponseRegister(_ reader: BufferReader) -> InputPasskeyResponse? { + var _1: Api.DataJSON? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.InputPasskeyResponse.inputPasskeyResponseRegister(Cons_inputPasskeyResponseRegister(clientData: _1!, attestationData: _2!)) + } + else { + return nil + } + } + } +} public extension Api { enum InputPaymentCredentials: TypeConstructorDescription { public class Cons_inputPaymentCredentials: TypeConstructorDescription { diff --git a/submodules/TelegramApi/Sources/Api16.swift b/submodules/TelegramApi/Sources/Api16.swift index 4081cd7796..521788dd10 100644 --- a/submodules/TelegramApi/Sources/Api16.swift +++ b/submodules/TelegramApi/Sources/Api16.swift @@ -1286,13 +1286,15 @@ public extension Api { public var flags: Int32 public var photo: Api.Photo? public var ttlSeconds: Int32? - public init(flags: Int32, photo: Api.Photo?, ttlSeconds: Int32?) { + public var video: Api.Document? + public init(flags: Int32, photo: Api.Photo?, ttlSeconds: Int32?, video: Api.Document?) { self.flags = flags self.photo = photo self.ttlSeconds = ttlSeconds + self.video = video } public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaPhoto", [("flags", self.flags as Any), ("photo", self.photo as Any), ("ttlSeconds", self.ttlSeconds as Any)]) + return ("messageMediaPhoto", [("flags", self.flags as Any), ("photo", self.photo as Any), ("ttlSeconds", self.ttlSeconds as Any), ("video", self.video as Any)]) } } public class Cons_messageMediaPoll: TypeConstructorDescription { @@ -1564,7 +1566,7 @@ public extension Api { break case .messageMediaPhoto(let _data): if boxed { - buffer.appendInt32(1766936791) + buffer.appendInt32(-501814429) } serializeInt32(_data.flags, buffer: buffer, boxed: false) if Int(_data.flags) & Int(1 << 0) != 0 { @@ -1573,6 +1575,9 @@ public extension Api { if Int(_data.flags) & Int(1 << 2) != 0 { serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.video!.serialize(buffer, true) + } break case .messageMediaPoll(let _data): if boxed { @@ -1664,7 +1669,7 @@ public extension Api { case .messageMediaPaidMedia(let _data): return ("messageMediaPaidMedia", [("starsAmount", _data.starsAmount as Any), ("extendedMedia", _data.extendedMedia as Any)]) case .messageMediaPhoto(let _data): - return ("messageMediaPhoto", [("flags", _data.flags as Any), ("photo", _data.photo as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + return ("messageMediaPhoto", [("flags", _data.flags as Any), ("photo", _data.photo as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("video", _data.video as Any)]) case .messageMediaPoll(let _data): return ("messageMediaPoll", [("poll", _data.poll as Any), ("results", _data.results as Any)]) case .messageMediaStory(let _data): @@ -1998,11 +2003,18 @@ public extension Api { if Int(_1!) & Int(1 << 2) != 0 { _3 = reader.readInt32() } + var _4: Api.Document? + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Document + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageMedia.messageMediaPhoto(Cons_messageMediaPhoto(flags: _1!, photo: _2, ttlSeconds: _3)) + let _c4 = (Int(_1!) & Int(1 << 4) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageMedia.messageMediaPhoto(Cons_messageMediaPhoto(flags: _1!, photo: _2, ttlSeconds: _3, video: _4)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api40.swift b/submodules/TelegramApi/Sources/Api40.swift index a696afe4c2..6c1eb0298f 100644 --- a/submodules/TelegramApi/Sources/Api40.swift +++ b/submodules/TelegramApi/Sources/Api40.swift @@ -8258,6 +8258,22 @@ public extension Api.functions.messages { }) } } +public extension Api.functions.messages { + static func reportMusicListen(id: Api.InputDocument, listenedDuration: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-574826471) + id.serialize(buffer, true) + serializeInt32(listenedDuration, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.reportMusicListen", parameters: [("id", String(describing: id)), ("listenedDuration", String(describing: listenedDuration))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} public extension Api.functions.messages { static func reportReaction(peer: Api.InputPeer, id: Int32, reactionPeer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -8275,6 +8291,26 @@ public extension Api.functions.messages { }) } } +public extension Api.functions.messages { + static func reportReadMetrics(peer: Api.InputPeer, metrics: [Api.InputMessageReadMetric]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1080542694) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(metrics.count)) + for item in metrics { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.reportReadMetrics", parameters: [("peer", String(describing: peer)), ("metrics", String(describing: metrics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} public extension Api.functions.messages { static func reportSpam(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -9686,9 +9722,9 @@ public extension Api.functions.messages { } } public extension Api.functions.messages { - static func translateText(flags: Int32, peer: Api.InputPeer?, id: [Int32]?, text: [Api.TextWithEntities]?, toLang: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + static func translateText(flags: Int32, peer: Api.InputPeer?, id: [Int32]?, text: [Api.TextWithEntities]?, toLang: String, tone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() - buffer.appendInt32(1662529584) + buffer.appendInt32(-1511079099) serializeInt32(flags, buffer: buffer, boxed: false) if Int(flags) & Int(1 << 0) != 0 { peer!.serialize(buffer, true) @@ -9708,7 +9744,10 @@ public extension Api.functions.messages { } } serializeString(toLang, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.translateText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("text", String(describing: text)), ("toLang", String(describing: toLang))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranslatedText? in + if Int(flags) & Int(1 << 2) != 0 { + serializeString(tone!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.translateText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("text", String(describing: text)), ("toLang", String(describing: toLang)), ("tone", String(describing: tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranslatedText? in let reader = BufferReader(buffer) var result: Api.messages.TranslatedText? if let signature = reader.readInt32() {