mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Update API
This commit is contained in:
parent
33d598cbe7
commit
6c1376169c
30 changed files with 1199 additions and 245 deletions
|
|
@ -415,9 +415,9 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-104578748] = { return Api.InputMedia.parse_inputMediaGeoPoint($0) }
|
||||
dict[1080028941] = { return Api.InputMedia.parse_inputMediaInvoice($0) }
|
||||
dict[-1005571194] = { return Api.InputMedia.parse_inputMediaPaidMedia($0) }
|
||||
dict[-1279654347] = { return Api.InputMedia.parse_inputMediaPhoto($0) }
|
||||
dict[-475053004] = { return Api.InputMedia.parse_inputMediaPhoto($0) }
|
||||
dict[-440664550] = { return Api.InputMedia.parse_inputMediaPhotoExternal($0) }
|
||||
dict[261416433] = { return Api.InputMedia.parse_inputMediaPoll($0) }
|
||||
dict[-1229194966] = { return Api.InputMedia.parse_inputMediaPoll($0) }
|
||||
dict[-207018934] = { return Api.InputMedia.parse_inputMediaStakeDice($0) }
|
||||
dict[-1979852936] = { return Api.InputMedia.parse_inputMediaStory($0) }
|
||||
dict[-1614454818] = { return Api.InputMedia.parse_inputMediaTodo($0) }
|
||||
|
|
@ -681,7 +681,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-156940077] = { return Api.MessageMedia.parse_messageMediaInvoice($0) }
|
||||
dict[-1467669359] = { return Api.MessageMedia.parse_messageMediaPaidMedia($0) }
|
||||
dict[-501814429] = { return Api.MessageMedia.parse_messageMediaPhoto($0) }
|
||||
dict[1272375192] = { return Api.MessageMedia.parse_messageMediaPoll($0) }
|
||||
dict[2000637542] = { return Api.MessageMedia.parse_messageMediaPoll($0) }
|
||||
dict[1758159491] = { return Api.MessageMedia.parse_messageMediaStory($0) }
|
||||
dict[-1974226924] = { return Api.MessageMedia.parse_messageMediaToDo($0) }
|
||||
dict[-1618676578] = { return Api.MessageMedia.parse_messageMediaUnsupported($0) }
|
||||
|
|
@ -814,9 +814,10 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-96535659] = { return Api.PhotoSize.parse_photoSizeProgressive($0) }
|
||||
dict[-525288402] = { return Api.PhotoSize.parse_photoStrippedSize($0) }
|
||||
dict[1484026161] = { return Api.Poll.parse_poll($0) }
|
||||
dict[-15277366] = { return Api.PollAnswer.parse_pollAnswer($0) }
|
||||
dict[997055186] = { return Api.PollAnswerVoters.parse_pollAnswerVoters($0) }
|
||||
dict[2061444128] = { return Api.PollResults.parse_pollResults($0) }
|
||||
dict[-237102592] = { return Api.PollAnswer.parse_inputPollAnswer($0) }
|
||||
dict[-779361553] = { return Api.PollAnswer.parse_pollAnswer($0) }
|
||||
dict[910500618] = { return Api.PollAnswerVoters.parse_pollAnswerVoters($0) }
|
||||
dict[-1166298786] = { return Api.PollResults.parse_pollResults($0) }
|
||||
dict[1558266229] = { return Api.PopularContact.parse_popularContact($0) }
|
||||
dict[512535275] = { return Api.PostAddress.parse_postAddress($0) }
|
||||
dict[-419066241] = { return Api.PostInteractionCounters.parse_postInteractionCountersMessage($0) }
|
||||
|
|
@ -1160,6 +1161,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[1442983757] = { return Api.Update.parse_updateLangPack($0) }
|
||||
dict[1180041828] = { return Api.Update.parse_updateLangPackTooLong($0) }
|
||||
dict[1448076945] = { return Api.Update.parse_updateLoginToken($0) }
|
||||
dict[1216408986] = { return Api.Update.parse_updateManagedBot($0) }
|
||||
dict[-710666460] = { return Api.Update.parse_updateMessageExtendedMedia($0) }
|
||||
dict[1318109142] = { return Api.Update.parse_updateMessageID($0) }
|
||||
dict[-1398708869] = { return Api.Update.parse_updateMessagePoll($0) }
|
||||
|
|
@ -1250,7 +1252,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-117904610] = { return Api.UrlAuthResult.parse_urlAuthResultRequest($0) }
|
||||
dict[829899656] = { return Api.User.parse_user($0) }
|
||||
dict[-742634630] = { return Api.User.parse_userEmpty($0) }
|
||||
dict[-1607745218] = { return Api.UserFull.parse_userFull($0) }
|
||||
dict[-1577103027] = { return Api.UserFull.parse_userFull($0) }
|
||||
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
|
||||
dict[1326562017] = { return Api.UserProfilePhoto.parse_userProfilePhotoEmpty($0) }
|
||||
dict[164646985] = { return Api.UserStatus.parse_userStatusEmpty($0) }
|
||||
|
|
@ -1348,6 +1350,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-1284008785] = { return Api.auth.SentCodeType.parse_sentCodeTypeSmsPhrase($0) }
|
||||
dict[-1542017919] = { return Api.auth.SentCodeType.parse_sentCodeTypeSmsWord($0) }
|
||||
dict[-391678544] = { return Api.bots.BotInfo.parse_botInfo($0) }
|
||||
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[-309659827] = { return Api.channels.AdminLogResults.parse_adminLogResults($0) }
|
||||
|
|
@ -2477,6 +2480,8 @@ public extension Api {
|
|||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.bots.BotInfo:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.bots.ExportedBotToken:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.bots.PopularAppBots:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.bots.PreviewInfo:
|
||||
|
|
|
|||
|
|
@ -141,13 +141,15 @@ public extension Api {
|
|||
public var flags: Int32
|
||||
public var id: Api.InputPhoto
|
||||
public var ttlSeconds: Int32?
|
||||
public init(flags: Int32, id: Api.InputPhoto, ttlSeconds: Int32?) {
|
||||
public var video: Api.InputDocument?
|
||||
public init(flags: Int32, id: Api.InputPhoto, ttlSeconds: Int32?, video: Api.InputDocument?) {
|
||||
self.flags = flags
|
||||
self.id = id
|
||||
self.ttlSeconds = ttlSeconds
|
||||
self.video = video
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("inputMediaPhoto", [("flags", self.flags as Any), ("id", self.id as Any), ("ttlSeconds", self.ttlSeconds as Any)])
|
||||
return ("inputMediaPhoto", [("flags", self.flags as Any), ("id", self.id as Any), ("ttlSeconds", self.ttlSeconds as Any), ("video", self.video as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_inputMediaPhotoExternal: TypeConstructorDescription {
|
||||
|
|
@ -167,17 +169,21 @@ public extension Api {
|
|||
public var flags: Int32
|
||||
public var poll: Api.Poll
|
||||
public var correctAnswers: [Buffer]?
|
||||
public var attachedMedia: Api.InputMedia?
|
||||
public var solution: String?
|
||||
public var solutionEntities: [Api.MessageEntity]?
|
||||
public init(flags: Int32, poll: Api.Poll, correctAnswers: [Buffer]?, solution: String?, solutionEntities: [Api.MessageEntity]?) {
|
||||
public var solutionMedia: Api.InputMedia?
|
||||
public init(flags: Int32, poll: Api.Poll, correctAnswers: [Buffer]?, attachedMedia: Api.InputMedia?, solution: String?, solutionEntities: [Api.MessageEntity]?, solutionMedia: Api.InputMedia?) {
|
||||
self.flags = flags
|
||||
self.poll = poll
|
||||
self.correctAnswers = correctAnswers
|
||||
self.attachedMedia = attachedMedia
|
||||
self.solution = solution
|
||||
self.solutionEntities = solutionEntities
|
||||
self.solutionMedia = solutionMedia
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("inputMediaPoll", [("flags", self.flags as Any), ("poll", self.poll as Any), ("correctAnswers", self.correctAnswers as Any), ("solution", self.solution as Any), ("solutionEntities", self.solutionEntities as Any)])
|
||||
return ("inputMediaPoll", [("flags", self.flags as Any), ("poll", self.poll as Any), ("correctAnswers", self.correctAnswers as Any), ("attachedMedia", self.attachedMedia as Any), ("solution", self.solution as Any), ("solutionEntities", self.solutionEntities as Any), ("solutionMedia", self.solutionMedia as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_inputMediaStakeDice: TypeConstructorDescription {
|
||||
|
|
@ -431,13 +437,16 @@ public extension Api {
|
|||
break
|
||||
case .inputMediaPhoto(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1279654347)
|
||||
buffer.appendInt32(-475053004)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
_data.id.serialize(buffer, true)
|
||||
if Int(_data.flags) & Int(1 << 0) != 0 {
|
||||
serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false)
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 2) != 0 {
|
||||
_data.video!.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .inputMediaPhotoExternal(let _data):
|
||||
if boxed {
|
||||
|
|
@ -451,7 +460,7 @@ public extension Api {
|
|||
break
|
||||
case .inputMediaPoll(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(261416433)
|
||||
buffer.appendInt32(-1229194966)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
_data.poll.serialize(buffer, true)
|
||||
|
|
@ -462,6 +471,9 @@ public extension Api {
|
|||
serializeBytes(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 3) != 0 {
|
||||
_data.attachedMedia!.serialize(buffer, true)
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 1) != 0 {
|
||||
serializeString(_data.solution!, buffer: buffer, boxed: false)
|
||||
}
|
||||
|
|
@ -472,6 +484,9 @@ public extension Api {
|
|||
item.serialize(buffer, true)
|
||||
}
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 2) != 0 {
|
||||
_data.solutionMedia!.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .inputMediaStakeDice(let _data):
|
||||
if boxed {
|
||||
|
|
@ -590,11 +605,11 @@ public extension Api {
|
|||
case .inputMediaPaidMedia(let _data):
|
||||
return ("inputMediaPaidMedia", [("flags", _data.flags as Any), ("starsAmount", _data.starsAmount as Any), ("extendedMedia", _data.extendedMedia as Any), ("payload", _data.payload as Any)])
|
||||
case .inputMediaPhoto(let _data):
|
||||
return ("inputMediaPhoto", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ttlSeconds", _data.ttlSeconds as Any)])
|
||||
return ("inputMediaPhoto", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("video", _data.video as Any)])
|
||||
case .inputMediaPhotoExternal(let _data):
|
||||
return ("inputMediaPhotoExternal", [("flags", _data.flags as Any), ("url", _data.url as Any), ("ttlSeconds", _data.ttlSeconds as Any)])
|
||||
case .inputMediaPoll(let _data):
|
||||
return ("inputMediaPoll", [("flags", _data.flags as Any), ("poll", _data.poll as Any), ("correctAnswers", _data.correctAnswers as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any)])
|
||||
return ("inputMediaPoll", [("flags", _data.flags as Any), ("poll", _data.poll as Any), ("correctAnswers", _data.correctAnswers as Any), ("attachedMedia", _data.attachedMedia as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any), ("solutionMedia", _data.solutionMedia as Any)])
|
||||
case .inputMediaStakeDice(let _data):
|
||||
return ("inputMediaStakeDice", [("gameHash", _data.gameHash as Any), ("tonAmount", _data.tonAmount as Any), ("clientSeed", _data.clientSeed as Any)])
|
||||
case .inputMediaStory(let _data):
|
||||
|
|
@ -861,11 +876,18 @@ public extension Api {
|
|||
if Int(_1!) & Int(1 << 0) != 0 {
|
||||
_3 = reader.readInt32()
|
||||
}
|
||||
var _4: Api.InputDocument?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = 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
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.InputMedia.inputMediaPhoto(Cons_inputMediaPhoto(flags: _1!, id: _2!, ttlSeconds: _3))
|
||||
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.InputMedia.inputMediaPhoto(Cons_inputMediaPhoto(flags: _1!, id: _2!, ttlSeconds: _3, video: _4))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
@ -903,23 +925,37 @@ public extension Api {
|
|||
_3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self)
|
||||
}
|
||||
}
|
||||
var _4: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {
|
||||
_4 = parseString(reader)
|
||||
var _4: Api.InputMedia?
|
||||
if Int(_1!) & Int(1 << 3) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.InputMedia
|
||||
}
|
||||
}
|
||||
var _5: [Api.MessageEntity]?
|
||||
var _5: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {
|
||||
_5 = parseString(reader)
|
||||
}
|
||||
var _6: [Api.MessageEntity]?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {
|
||||
if let _ = reader.readInt32() {
|
||||
_5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||
_6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||
}
|
||||
}
|
||||
var _7: Api.InputMedia?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_7 = Api.parse(reader, signature: signature) as? Api.InputMedia
|
||||
}
|
||||
}
|
||||
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
|
||||
let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.InputMedia.inputMediaPoll(Cons_inputMediaPoll(flags: _1!, poll: _2!, correctAnswers: _3, solution: _4, solutionEntities: _5))
|
||||
let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil
|
||||
let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
||||
return Api.InputMedia.inputMediaPoll(Cons_inputMediaPoll(flags: _1!, poll: _2!, correctAnswers: _3, attachedMedia: _4, solution: _5, solutionEntities: _6, solutionMedia: _7))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -1298,14 +1298,18 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
public class Cons_messageMediaPoll: TypeConstructorDescription {
|
||||
public var flags: Int32
|
||||
public var poll: Api.Poll
|
||||
public var results: Api.PollResults
|
||||
public init(poll: Api.Poll, results: Api.PollResults) {
|
||||
public var attachedMedia: Api.MessageMedia?
|
||||
public init(flags: Int32, poll: Api.Poll, results: Api.PollResults, attachedMedia: Api.MessageMedia?) {
|
||||
self.flags = flags
|
||||
self.poll = poll
|
||||
self.results = results
|
||||
self.attachedMedia = attachedMedia
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("messageMediaPoll", [("poll", self.poll as Any), ("results", self.results as Any)])
|
||||
return ("messageMediaPoll", [("flags", self.flags as Any), ("poll", self.poll as Any), ("results", self.results as Any), ("attachedMedia", self.attachedMedia as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_messageMediaStory: TypeConstructorDescription {
|
||||
|
|
@ -1581,10 +1585,14 @@ public extension Api {
|
|||
break
|
||||
case .messageMediaPoll(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(1272375192)
|
||||
buffer.appendInt32(2000637542)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
_data.poll.serialize(buffer, true)
|
||||
_data.results.serialize(buffer, true)
|
||||
if Int(_data.flags) & Int(1 << 0) != 0 {
|
||||
_data.attachedMedia!.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .messageMediaStory(let _data):
|
||||
if boxed {
|
||||
|
|
@ -1671,7 +1679,7 @@ public extension Api {
|
|||
case .messageMediaPhoto(let _data):
|
||||
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)])
|
||||
return ("messageMediaPoll", [("flags", _data.flags as Any), ("poll", _data.poll as Any), ("results", _data.results as Any), ("attachedMedia", _data.attachedMedia as Any)])
|
||||
case .messageMediaStory(let _data):
|
||||
return ("messageMediaStory", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("id", _data.id as Any), ("story", _data.story as Any)])
|
||||
case .messageMediaToDo(let _data):
|
||||
|
|
@ -2021,18 +2029,28 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
public static func parse_messageMediaPoll(_ reader: BufferReader) -> MessageMedia? {
|
||||
var _1: Api.Poll?
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.Poll?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.Poll
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.Poll
|
||||
}
|
||||
var _2: Api.PollResults?
|
||||
var _3: Api.PollResults?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.PollResults
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.PollResults
|
||||
}
|
||||
var _4: Api.MessageMedia?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.MessageMedia
|
||||
}
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.MessageMedia.messageMediaPoll(Cons_messageMediaPoll(poll: _1!, results: _2!))
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.MessageMedia.messageMediaPoll(Cons_messageMediaPoll(flags: _1!, poll: _2!, results: _3!, attachedMedia: _4))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -776,50 +776,123 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum PollAnswer: TypeConstructorDescription {
|
||||
public class Cons_pollAnswer: TypeConstructorDescription {
|
||||
indirect enum PollAnswer: TypeConstructorDescription {
|
||||
public class Cons_inputPollAnswer: TypeConstructorDescription {
|
||||
public var flags: Int32
|
||||
public var text: Api.TextWithEntities
|
||||
public var option: Buffer
|
||||
public init(text: Api.TextWithEntities, option: Buffer) {
|
||||
public var media: Api.InputMedia?
|
||||
public init(flags: Int32, text: Api.TextWithEntities, option: Buffer, media: Api.InputMedia?) {
|
||||
self.flags = flags
|
||||
self.text = text
|
||||
self.option = option
|
||||
self.media = media
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("pollAnswer", [("text", self.text as Any), ("option", self.option as Any)])
|
||||
return ("inputPollAnswer", [("flags", self.flags as Any), ("text", self.text as Any), ("option", self.option as Any), ("media", self.media as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_pollAnswer: TypeConstructorDescription {
|
||||
public var flags: Int32
|
||||
public var text: Api.TextWithEntities
|
||||
public var option: Buffer
|
||||
public var media: Api.MessageMedia?
|
||||
public init(flags: Int32, text: Api.TextWithEntities, option: Buffer, media: Api.MessageMedia?) {
|
||||
self.flags = flags
|
||||
self.text = text
|
||||
self.option = option
|
||||
self.media = media
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("pollAnswer", [("flags", self.flags as Any), ("text", self.text as Any), ("option", self.option as Any), ("media", self.media as Any)])
|
||||
}
|
||||
}
|
||||
case inputPollAnswer(Cons_inputPollAnswer)
|
||||
case pollAnswer(Cons_pollAnswer)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .pollAnswer(let _data):
|
||||
case .inputPollAnswer(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-15277366)
|
||||
buffer.appendInt32(-237102592)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
_data.text.serialize(buffer, true)
|
||||
serializeBytes(_data.option, buffer: buffer, boxed: false)
|
||||
if Int(_data.flags) & Int(1 << 0) != 0 {
|
||||
_data.media!.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .pollAnswer(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-779361553)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
_data.text.serialize(buffer, true)
|
||||
serializeBytes(_data.option, buffer: buffer, boxed: false)
|
||||
if Int(_data.flags) & Int(1 << 0) != 0 {
|
||||
_data.media!.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .inputPollAnswer(let _data):
|
||||
return ("inputPollAnswer", [("flags", _data.flags as Any), ("text", _data.text as Any), ("option", _data.option as Any), ("media", _data.media as Any)])
|
||||
case .pollAnswer(let _data):
|
||||
return ("pollAnswer", [("text", _data.text as Any), ("option", _data.option as Any)])
|
||||
return ("pollAnswer", [("flags", _data.flags as Any), ("text", _data.text as Any), ("option", _data.option as Any), ("media", _data.media as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_pollAnswer(_ reader: BufferReader) -> PollAnswer? {
|
||||
var _1: Api.TextWithEntities?
|
||||
public static func parse_inputPollAnswer(_ reader: BufferReader) -> PollAnswer? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.TextWithEntities?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
}
|
||||
var _3: Buffer?
|
||||
_3 = parseBytes(reader)
|
||||
var _4: Api.InputMedia?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.InputMedia
|
||||
}
|
||||
}
|
||||
var _2: Buffer?
|
||||
_2 = parseBytes(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.PollAnswer.pollAnswer(Cons_pollAnswer(text: _1!, option: _2!))
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.PollAnswer.inputPollAnswer(Cons_inputPollAnswer(flags: _1!, text: _2!, option: _3!, media: _4))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_pollAnswer(_ reader: BufferReader) -> PollAnswer? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Api.TextWithEntities?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
}
|
||||
var _3: Buffer?
|
||||
_3 = parseBytes(reader)
|
||||
var _4: Api.MessageMedia?
|
||||
if Int(_1!) & Int(1 << 0) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_4 = Api.parse(reader, signature: signature) as? Api.MessageMedia
|
||||
}
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.PollAnswer.pollAnswer(Cons_pollAnswer(flags: _1!, text: _2!, option: _3!, media: _4))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
@ -832,14 +905,16 @@ public extension Api {
|
|||
public class Cons_pollAnswerVoters: TypeConstructorDescription {
|
||||
public var flags: Int32
|
||||
public var option: Buffer
|
||||
public var voters: Int32
|
||||
public init(flags: Int32, option: Buffer, voters: Int32) {
|
||||
public var voters: Int32?
|
||||
public var recentVoters: [Api.Peer]?
|
||||
public init(flags: Int32, option: Buffer, voters: Int32?, recentVoters: [Api.Peer]?) {
|
||||
self.flags = flags
|
||||
self.option = option
|
||||
self.voters = voters
|
||||
self.recentVoters = recentVoters
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("pollAnswerVoters", [("flags", self.flags as Any), ("option", self.option as Any), ("voters", self.voters as Any)])
|
||||
return ("pollAnswerVoters", [("flags", self.flags as Any), ("option", self.option as Any), ("voters", self.voters as Any), ("recentVoters", self.recentVoters as Any)])
|
||||
}
|
||||
}
|
||||
case pollAnswerVoters(Cons_pollAnswerVoters)
|
||||
|
|
@ -848,11 +923,20 @@ public extension Api {
|
|||
switch self {
|
||||
case .pollAnswerVoters(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(997055186)
|
||||
buffer.appendInt32(910500618)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
serializeBytes(_data.option, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.voters, buffer: buffer, boxed: false)
|
||||
if Int(_data.flags) & Int(1 << 2) != 0 {
|
||||
serializeInt32(_data.voters!, buffer: buffer, boxed: false)
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 2) != 0 {
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(_data.recentVoters!.count))
|
||||
for item in _data.recentVoters! {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -860,7 +944,7 @@ public extension Api {
|
|||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .pollAnswerVoters(let _data):
|
||||
return ("pollAnswerVoters", [("flags", _data.flags as Any), ("option", _data.option as Any), ("voters", _data.voters as Any)])
|
||||
return ("pollAnswerVoters", [("flags", _data.flags as Any), ("option", _data.option as Any), ("voters", _data.voters as Any), ("recentVoters", _data.recentVoters as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -870,12 +954,21 @@ public extension Api {
|
|||
var _2: Buffer?
|
||||
_2 = parseBytes(reader)
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
if Int(_1!) & Int(1 << 2) != 0 {
|
||||
_3 = reader.readInt32()
|
||||
}
|
||||
var _4: [Api.Peer]?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {
|
||||
if let _ = reader.readInt32() {
|
||||
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self)
|
||||
}
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.PollAnswerVoters.pollAnswerVoters(Cons_pollAnswerVoters(flags: _1!, option: _2!, voters: _3!))
|
||||
let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.PollAnswerVoters.pollAnswerVoters(Cons_pollAnswerVoters(flags: _1!, option: _2!, voters: _3, recentVoters: _4))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
@ -884,7 +977,7 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum PollResults: TypeConstructorDescription {
|
||||
indirect enum PollResults: TypeConstructorDescription {
|
||||
public class Cons_pollResults: TypeConstructorDescription {
|
||||
public var flags: Int32
|
||||
public var results: [Api.PollAnswerVoters]?
|
||||
|
|
@ -892,16 +985,18 @@ public extension Api {
|
|||
public var recentVoters: [Api.Peer]?
|
||||
public var solution: String?
|
||||
public var solutionEntities: [Api.MessageEntity]?
|
||||
public init(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?, recentVoters: [Api.Peer]?, solution: String?, solutionEntities: [Api.MessageEntity]?) {
|
||||
public var solutionMedia: Api.MessageMedia?
|
||||
public init(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?, recentVoters: [Api.Peer]?, solution: String?, solutionEntities: [Api.MessageEntity]?, solutionMedia: Api.MessageMedia?) {
|
||||
self.flags = flags
|
||||
self.results = results
|
||||
self.totalVoters = totalVoters
|
||||
self.recentVoters = recentVoters
|
||||
self.solution = solution
|
||||
self.solutionEntities = solutionEntities
|
||||
self.solutionMedia = solutionMedia
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("pollResults", [("flags", self.flags as Any), ("results", self.results as Any), ("totalVoters", self.totalVoters as Any), ("recentVoters", self.recentVoters as Any), ("solution", self.solution as Any), ("solutionEntities", self.solutionEntities as Any)])
|
||||
return ("pollResults", [("flags", self.flags as Any), ("results", self.results as Any), ("totalVoters", self.totalVoters as Any), ("recentVoters", self.recentVoters as Any), ("solution", self.solution as Any), ("solutionEntities", self.solutionEntities as Any), ("solutionMedia", self.solutionMedia as Any)])
|
||||
}
|
||||
}
|
||||
case pollResults(Cons_pollResults)
|
||||
|
|
@ -910,7 +1005,7 @@ public extension Api {
|
|||
switch self {
|
||||
case .pollResults(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(2061444128)
|
||||
buffer.appendInt32(-1166298786)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
if Int(_data.flags) & Int(1 << 1) != 0 {
|
||||
|
|
@ -940,6 +1035,9 @@ public extension Api {
|
|||
item.serialize(buffer, true)
|
||||
}
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 5) != 0 {
|
||||
_data.solutionMedia!.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -947,7 +1045,7 @@ public extension Api {
|
|||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .pollResults(let _data):
|
||||
return ("pollResults", [("flags", _data.flags as Any), ("results", _data.results as Any), ("totalVoters", _data.totalVoters as Any), ("recentVoters", _data.recentVoters as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any)])
|
||||
return ("pollResults", [("flags", _data.flags as Any), ("results", _data.results as Any), ("totalVoters", _data.totalVoters as Any), ("recentVoters", _data.recentVoters as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any), ("solutionMedia", _data.solutionMedia as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -980,14 +1078,21 @@ public extension Api {
|
|||
_6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
||||
}
|
||||
}
|
||||
var _7: Api.MessageMedia?
|
||||
if Int(_1!) & Int(1 << 5) != 0 {
|
||||
if let signature = reader.readInt32() {
|
||||
_7 = Api.parse(reader, signature: signature) as? Api.MessageMedia
|
||||
}
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 4) == 0) || _5 != nil
|
||||
let _c6 = (Int(_1!) & Int(1 << 4) == 0) || _6 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
||||
return Api.PollResults.pollResults(Cons_pollResults(flags: _1!, results: _2, totalVoters: _3, recentVoters: _4, solution: _5, solutionEntities: _6))
|
||||
let _c7 = (Int(_1!) & Int(1 << 5) == 0) || _7 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
||||
return Api.PollResults.pollResults(Cons_pollResults(flags: _1!, results: _2, totalVoters: _3, recentVoters: _4, solution: _5, solutionEntities: _6, solutionMedia: _7))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -1020,6 +1020,19 @@ public extension Api {
|
|||
return ("updateLangPackTooLong", [("langCode", self.langCode as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_updateManagedBot: TypeConstructorDescription {
|
||||
public var userId: Int64
|
||||
public var botId: Int64
|
||||
public var qts: Int32
|
||||
public init(userId: Int64, botId: Int64, qts: Int32) {
|
||||
self.userId = userId
|
||||
self.botId = botId
|
||||
self.qts = qts
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("updateManagedBot", [("userId", self.userId as Any), ("botId", self.botId as Any), ("qts", self.qts as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_updateMessageExtendedMedia: TypeConstructorDescription {
|
||||
public var peer: Api.Peer
|
||||
public var msgId: Int32
|
||||
|
|
@ -1937,6 +1950,7 @@ public extension Api {
|
|||
case updateLangPack(Cons_updateLangPack)
|
||||
case updateLangPackTooLong(Cons_updateLangPackTooLong)
|
||||
case updateLoginToken
|
||||
case updateManagedBot(Cons_updateManagedBot)
|
||||
case updateMessageExtendedMedia(Cons_updateMessageExtendedMedia)
|
||||
case updateMessageID(Cons_updateMessageID)
|
||||
case updateMessagePoll(Cons_updateMessagePoll)
|
||||
|
|
@ -2763,6 +2777,14 @@ public extension Api {
|
|||
buffer.appendInt32(1448076945)
|
||||
}
|
||||
break
|
||||
case .updateManagedBot(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(1216408986)
|
||||
}
|
||||
serializeInt64(_data.userId, buffer: buffer, boxed: false)
|
||||
serializeInt64(_data.botId, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.qts, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .updateMessageExtendedMedia(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-710666460)
|
||||
|
|
@ -3591,6 +3613,8 @@ public extension Api {
|
|||
return ("updateLangPackTooLong", [("langCode", _data.langCode as Any)])
|
||||
case .updateLoginToken:
|
||||
return ("updateLoginToken", [])
|
||||
case .updateManagedBot(let _data):
|
||||
return ("updateManagedBot", [("userId", _data.userId as Any), ("botId", _data.botId as Any), ("qts", _data.qts as Any)])
|
||||
case .updateMessageExtendedMedia(let _data):
|
||||
return ("updateMessageExtendedMedia", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("extendedMedia", _data.extendedMedia as Any)])
|
||||
case .updateMessageID(let _data):
|
||||
|
|
@ -5269,6 +5293,23 @@ public extension Api {
|
|||
public static func parse_updateLoginToken(_ reader: BufferReader) -> Update? {
|
||||
return Api.Update.updateLoginToken
|
||||
}
|
||||
public static func parse_updateManagedBot(_ reader: BufferReader) -> Update? {
|
||||
var _1: Int64?
|
||||
_1 = reader.readInt64()
|
||||
var _2: Int64?
|
||||
_2 = reader.readInt64()
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
if _c1 && _c2 && _c3 {
|
||||
return Api.Update.updateManagedBot(Cons_updateManagedBot(userId: _1!, botId: _2!, qts: _3!))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_updateMessageExtendedMedia(_ reader: BufferReader) -> Update? {
|
||||
var _1: Api.Peer?
|
||||
if let signature = reader.readInt32() {
|
||||
|
|
|
|||
|
|
@ -1071,7 +1071,8 @@ public extension Api {
|
|||
public var mainTab: Api.ProfileTab?
|
||||
public var savedMusic: Api.Document?
|
||||
public var note: Api.TextWithEntities?
|
||||
public init(flags: Int32, flags2: Int32, id: Int64, about: String?, settings: Api.PeerSettings, personalPhoto: Api.Photo?, profilePhoto: Api.Photo?, fallbackPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, botInfo: Api.BotInfo?, pinnedMsgId: Int32?, commonChatsCount: Int32, folderId: Int32?, ttlPeriod: Int32?, theme: Api.ChatTheme?, privateForwardName: String?, botGroupAdminRights: Api.ChatAdminRights?, botBroadcastAdminRights: Api.ChatAdminRights?, wallpaper: Api.WallPaper?, stories: Api.PeerStories?, businessWorkHours: Api.BusinessWorkHours?, businessLocation: Api.BusinessLocation?, businessGreetingMessage: Api.BusinessGreetingMessage?, businessAwayMessage: Api.BusinessAwayMessage?, businessIntro: Api.BusinessIntro?, birthday: Api.Birthday?, personalChannelId: Int64?, personalChannelMessage: Int32?, stargiftsCount: Int32?, starrefProgram: Api.StarRefProgram?, botVerification: Api.BotVerification?, sendPaidMessagesStars: Int64?, disallowedGifts: Api.DisallowedGiftsSettings?, starsRating: Api.StarsRating?, starsMyPendingRating: Api.StarsRating?, starsMyPendingRatingDate: Int32?, mainTab: Api.ProfileTab?, savedMusic: Api.Document?, note: Api.TextWithEntities?) {
|
||||
public var botManagerId: Int64?
|
||||
public init(flags: Int32, flags2: Int32, id: Int64, about: String?, settings: Api.PeerSettings, personalPhoto: Api.Photo?, profilePhoto: Api.Photo?, fallbackPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, botInfo: Api.BotInfo?, pinnedMsgId: Int32?, commonChatsCount: Int32, folderId: Int32?, ttlPeriod: Int32?, theme: Api.ChatTheme?, privateForwardName: String?, botGroupAdminRights: Api.ChatAdminRights?, botBroadcastAdminRights: Api.ChatAdminRights?, wallpaper: Api.WallPaper?, stories: Api.PeerStories?, businessWorkHours: Api.BusinessWorkHours?, businessLocation: Api.BusinessLocation?, businessGreetingMessage: Api.BusinessGreetingMessage?, businessAwayMessage: Api.BusinessAwayMessage?, businessIntro: Api.BusinessIntro?, birthday: Api.Birthday?, personalChannelId: Int64?, personalChannelMessage: Int32?, stargiftsCount: Int32?, starrefProgram: Api.StarRefProgram?, botVerification: Api.BotVerification?, sendPaidMessagesStars: Int64?, disallowedGifts: Api.DisallowedGiftsSettings?, starsRating: Api.StarsRating?, starsMyPendingRating: Api.StarsRating?, starsMyPendingRatingDate: Int32?, mainTab: Api.ProfileTab?, savedMusic: Api.Document?, note: Api.TextWithEntities?, botManagerId: Int64?) {
|
||||
self.flags = flags
|
||||
self.flags2 = flags2
|
||||
self.id = id
|
||||
|
|
@ -1111,9 +1112,10 @@ public extension Api {
|
|||
self.mainTab = mainTab
|
||||
self.savedMusic = savedMusic
|
||||
self.note = note
|
||||
self.botManagerId = botManagerId
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("userFull", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("about", self.about as Any), ("settings", self.settings as Any), ("personalPhoto", self.personalPhoto as Any), ("profilePhoto", self.profilePhoto as Any), ("fallbackPhoto", self.fallbackPhoto as Any), ("notifySettings", self.notifySettings as Any), ("botInfo", self.botInfo as Any), ("pinnedMsgId", self.pinnedMsgId as Any), ("commonChatsCount", self.commonChatsCount as Any), ("folderId", self.folderId as Any), ("ttlPeriod", self.ttlPeriod as Any), ("theme", self.theme as Any), ("privateForwardName", self.privateForwardName as Any), ("botGroupAdminRights", self.botGroupAdminRights as Any), ("botBroadcastAdminRights", self.botBroadcastAdminRights as Any), ("wallpaper", self.wallpaper as Any), ("stories", self.stories as Any), ("businessWorkHours", self.businessWorkHours as Any), ("businessLocation", self.businessLocation as Any), ("businessGreetingMessage", self.businessGreetingMessage as Any), ("businessAwayMessage", self.businessAwayMessage as Any), ("businessIntro", self.businessIntro as Any), ("birthday", self.birthday as Any), ("personalChannelId", self.personalChannelId as Any), ("personalChannelMessage", self.personalChannelMessage as Any), ("stargiftsCount", self.stargiftsCount as Any), ("starrefProgram", self.starrefProgram as Any), ("botVerification", self.botVerification as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any), ("disallowedGifts", self.disallowedGifts as Any), ("starsRating", self.starsRating as Any), ("starsMyPendingRating", self.starsMyPendingRating as Any), ("starsMyPendingRatingDate", self.starsMyPendingRatingDate as Any), ("mainTab", self.mainTab as Any), ("savedMusic", self.savedMusic as Any), ("note", self.note as Any)])
|
||||
return ("userFull", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("about", self.about as Any), ("settings", self.settings as Any), ("personalPhoto", self.personalPhoto as Any), ("profilePhoto", self.profilePhoto as Any), ("fallbackPhoto", self.fallbackPhoto as Any), ("notifySettings", self.notifySettings as Any), ("botInfo", self.botInfo as Any), ("pinnedMsgId", self.pinnedMsgId as Any), ("commonChatsCount", self.commonChatsCount as Any), ("folderId", self.folderId as Any), ("ttlPeriod", self.ttlPeriod as Any), ("theme", self.theme as Any), ("privateForwardName", self.privateForwardName as Any), ("botGroupAdminRights", self.botGroupAdminRights as Any), ("botBroadcastAdminRights", self.botBroadcastAdminRights as Any), ("wallpaper", self.wallpaper as Any), ("stories", self.stories as Any), ("businessWorkHours", self.businessWorkHours as Any), ("businessLocation", self.businessLocation as Any), ("businessGreetingMessage", self.businessGreetingMessage as Any), ("businessAwayMessage", self.businessAwayMessage as Any), ("businessIntro", self.businessIntro as Any), ("birthday", self.birthday as Any), ("personalChannelId", self.personalChannelId as Any), ("personalChannelMessage", self.personalChannelMessage as Any), ("stargiftsCount", self.stargiftsCount as Any), ("starrefProgram", self.starrefProgram as Any), ("botVerification", self.botVerification as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any), ("disallowedGifts", self.disallowedGifts as Any), ("starsRating", self.starsRating as Any), ("starsMyPendingRating", self.starsMyPendingRating as Any), ("starsMyPendingRatingDate", self.starsMyPendingRatingDate as Any), ("mainTab", self.mainTab as Any), ("savedMusic", self.savedMusic as Any), ("note", self.note as Any), ("botManagerId", self.botManagerId as Any)])
|
||||
}
|
||||
}
|
||||
case userFull(Cons_userFull)
|
||||
|
|
@ -1122,7 +1124,7 @@ public extension Api {
|
|||
switch self {
|
||||
case .userFull(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1607745218)
|
||||
buffer.appendInt32(-1577103027)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.flags2, buffer: buffer, boxed: false)
|
||||
|
|
@ -1229,6 +1231,9 @@ public extension Api {
|
|||
if Int(_data.flags2) & Int(1 << 22) != 0 {
|
||||
_data.note!.serialize(buffer, true)
|
||||
}
|
||||
if Int(_data.flags2) & Int(1 << 23) != 0 {
|
||||
serializeInt64(_data.botManagerId!, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -1236,7 +1241,7 @@ public extension Api {
|
|||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .userFull(let _data):
|
||||
return ("userFull", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("settings", _data.settings as Any), ("personalPhoto", _data.personalPhoto as Any), ("profilePhoto", _data.profilePhoto as Any), ("fallbackPhoto", _data.fallbackPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("botInfo", _data.botInfo as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("commonChatsCount", _data.commonChatsCount as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("theme", _data.theme as Any), ("privateForwardName", _data.privateForwardName as Any), ("botGroupAdminRights", _data.botGroupAdminRights as Any), ("botBroadcastAdminRights", _data.botBroadcastAdminRights as Any), ("wallpaper", _data.wallpaper as Any), ("stories", _data.stories as Any), ("businessWorkHours", _data.businessWorkHours as Any), ("businessLocation", _data.businessLocation as Any), ("businessGreetingMessage", _data.businessGreetingMessage as Any), ("businessAwayMessage", _data.businessAwayMessage as Any), ("businessIntro", _data.businessIntro as Any), ("birthday", _data.birthday as Any), ("personalChannelId", _data.personalChannelId as Any), ("personalChannelMessage", _data.personalChannelMessage as Any), ("stargiftsCount", _data.stargiftsCount as Any), ("starrefProgram", _data.starrefProgram as Any), ("botVerification", _data.botVerification as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("disallowedGifts", _data.disallowedGifts as Any), ("starsRating", _data.starsRating as Any), ("starsMyPendingRating", _data.starsMyPendingRating as Any), ("starsMyPendingRatingDate", _data.starsMyPendingRatingDate as Any), ("mainTab", _data.mainTab as Any), ("savedMusic", _data.savedMusic as Any), ("note", _data.note as Any)])
|
||||
return ("userFull", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("settings", _data.settings as Any), ("personalPhoto", _data.personalPhoto as Any), ("profilePhoto", _data.profilePhoto as Any), ("fallbackPhoto", _data.fallbackPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("botInfo", _data.botInfo as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("commonChatsCount", _data.commonChatsCount as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("theme", _data.theme as Any), ("privateForwardName", _data.privateForwardName as Any), ("botGroupAdminRights", _data.botGroupAdminRights as Any), ("botBroadcastAdminRights", _data.botBroadcastAdminRights as Any), ("wallpaper", _data.wallpaper as Any), ("stories", _data.stories as Any), ("businessWorkHours", _data.businessWorkHours as Any), ("businessLocation", _data.businessLocation as Any), ("businessGreetingMessage", _data.businessGreetingMessage as Any), ("businessAwayMessage", _data.businessAwayMessage as Any), ("businessIntro", _data.businessIntro as Any), ("birthday", _data.birthday as Any), ("personalChannelId", _data.personalChannelId as Any), ("personalChannelMessage", _data.personalChannelMessage as Any), ("stargiftsCount", _data.stargiftsCount as Any), ("starrefProgram", _data.starrefProgram as Any), ("botVerification", _data.botVerification as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("disallowedGifts", _data.disallowedGifts as Any), ("starsRating", _data.starsRating as Any), ("starsMyPendingRating", _data.starsMyPendingRating as Any), ("starsMyPendingRatingDate", _data.starsMyPendingRatingDate as Any), ("mainTab", _data.mainTab as Any), ("savedMusic", _data.savedMusic as Any), ("note", _data.note as Any), ("botManagerId", _data.botManagerId as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1435,6 +1440,10 @@ public extension Api {
|
|||
_39 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
}
|
||||
}
|
||||
var _40: Int64?
|
||||
if Int(_2!) & Int(1 << 23) != 0 {
|
||||
_40 = reader.readInt64()
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
|
|
@ -1474,8 +1483,9 @@ public extension Api {
|
|||
let _c37 = (Int(_2!) & Int(1 << 20) == 0) || _37 != nil
|
||||
let _c38 = (Int(_2!) & Int(1 << 21) == 0) || _38 != nil
|
||||
let _c39 = (Int(_2!) & Int(1 << 22) == 0) || _39 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 && _c25 && _c26 && _c27 && _c28 && _c29 && _c30 && _c31 && _c32 && _c33 && _c34 && _c35 && _c36 && _c37 && _c38 && _c39 {
|
||||
return Api.UserFull.userFull(Cons_userFull(flags: _1!, flags2: _2!, id: _3!, about: _4, settings: _5!, personalPhoto: _6, profilePhoto: _7, fallbackPhoto: _8, notifySettings: _9!, botInfo: _10, pinnedMsgId: _11, commonChatsCount: _12!, folderId: _13, ttlPeriod: _14, theme: _15, privateForwardName: _16, botGroupAdminRights: _17, botBroadcastAdminRights: _18, wallpaper: _19, stories: _20, businessWorkHours: _21, businessLocation: _22, businessGreetingMessage: _23, businessAwayMessage: _24, businessIntro: _25, birthday: _26, personalChannelId: _27, personalChannelMessage: _28, stargiftsCount: _29, starrefProgram: _30, botVerification: _31, sendPaidMessagesStars: _32, disallowedGifts: _33, starsRating: _34, starsMyPendingRating: _35, starsMyPendingRatingDate: _36, mainTab: _37, savedMusic: _38, note: _39))
|
||||
let _c40 = (Int(_2!) & Int(1 << 23) == 0) || _40 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 && _c25 && _c26 && _c27 && _c28 && _c29 && _c30 && _c31 && _c32 && _c33 && _c34 && _c35 && _c36 && _c37 && _c38 && _c39 && _c40 {
|
||||
return Api.UserFull.userFull(Cons_userFull(flags: _1!, flags2: _2!, id: _3!, about: _4, settings: _5!, personalPhoto: _6, profilePhoto: _7, fallbackPhoto: _8, notifySettings: _9!, botInfo: _10, pinnedMsgId: _11, commonChatsCount: _12!, folderId: _13, ttlPeriod: _14, theme: _15, privateForwardName: _16, botGroupAdminRights: _17, botBroadcastAdminRights: _18, wallpaper: _19, stories: _20, businessWorkHours: _21, businessLocation: _22, businessGreetingMessage: _23, businessAwayMessage: _24, businessIntro: _25, birthday: _26, personalChannelId: _27, personalChannelMessage: _28, stargiftsCount: _29, starrefProgram: _30, botVerification: _31, sendPaidMessagesStars: _32, disallowedGifts: _33, starsRating: _34, starsMyPendingRating: _35, starsMyPendingRatingDate: _36, mainTab: _37, savedMusic: _38, note: _39, botManagerId: _40))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -54,6 +54,50 @@ public extension Api.bots {
|
|||
}
|
||||
}
|
||||
}
|
||||
public extension Api.bots {
|
||||
enum ExportedBotToken: TypeConstructorDescription {
|
||||
public class Cons_exportedBotToken: TypeConstructorDescription {
|
||||
public var token: String
|
||||
public init(token: String) {
|
||||
self.token = token
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("exportedBotToken", [("token", self.token as Any)])
|
||||
}
|
||||
}
|
||||
case exportedBotToken(Cons_exportedBotToken)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .exportedBotToken(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(1012971041)
|
||||
}
|
||||
serializeString(_data.token, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .exportedBotToken(let _data):
|
||||
return ("exportedBotToken", [("token", _data.token as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_exportedBotToken(_ reader: BufferReader) -> ExportedBotToken? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.bots.ExportedBotToken.exportedBotToken(Cons_exportedBotToken(token: _1!))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public extension Api.bots {
|
||||
enum PopularAppBots: TypeConstructorDescription {
|
||||
public class Cons_popularAppBots: TypeConstructorDescription {
|
||||
|
|
|
|||
|
|
@ -2557,6 +2557,38 @@ public extension Api.functions.bots {
|
|||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.bots {
|
||||
static func checkUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-2014174821)
|
||||
serializeString(username, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription(name: "bots.checkUsername", parameters: [("username", String(describing: username))]), 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.bots {
|
||||
static func createBot(name: String, username: String, managerId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.User>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1656313365)
|
||||
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
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.User?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.User
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.bots {
|
||||
static func deletePreviewMedia(bot: Api.InputUser, langCode: String, media: [Api.InputMedia]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
let buffer = Buffer()
|
||||
|
|
@ -2596,6 +2628,22 @@ public extension Api.functions.bots {
|
|||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.bots {
|
||||
static func exportBotToken(botId: Int64, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.bots.ExportedBotToken>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(6533257)
|
||||
serializeInt64(botId, buffer: buffer, boxed: false)
|
||||
revoke.serialize(buffer, true)
|
||||
return (FunctionDescription(name: "bots.exportBotToken", parameters: [("botId", String(describing: botId)), ("revoke", String(describing: revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.ExportedBotToken? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.bots.ExportedBotToken?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.bots.ExportedBotToken
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.bots {
|
||||
static func getAdminedBots() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) {
|
||||
let buffer = Buffer()
|
||||
|
|
@ -5241,6 +5289,23 @@ public extension Api.functions.messages {
|
|||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.messages {
|
||||
static func addPollAnswer(peer: Api.InputPeer, msgId: Int32, answer: Api.PollAnswer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(431770477)
|
||||
peer.serialize(buffer, true)
|
||||
serializeInt32(msgId, buffer: buffer, boxed: false)
|
||||
answer.serialize(buffer, true)
|
||||
return (FunctionDescription(name: "messages.addPollAnswer", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("answer", String(describing: answer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Updates?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Updates
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.messages {
|
||||
static func appendTodoList(peer: Api.InputPeer, msgId: Int32, list: [Api.TodoItem]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
|
|
@ -9500,16 +9565,19 @@ public extension Api.functions.messages {
|
|||
}
|
||||
}
|
||||
public extension Api.functions.messages {
|
||||
static func summarizeText(flags: Int32, peer: Api.InputPeer, id: Int32, toLang: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.TextWithEntities>) {
|
||||
static func summarizeText(flags: Int32, peer: Api.InputPeer, id: Int32, toLang: String?, tone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.TextWithEntities>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1656683294)
|
||||
buffer.appendInt32(-1413754042)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
peer.serialize(buffer, true)
|
||||
serializeInt32(id, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 0) != 0 {
|
||||
serializeString(toLang!, buffer: buffer, boxed: false)
|
||||
}
|
||||
return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("toLang", String(describing: toLang))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.TextWithEntities? in
|
||||
if Int(flags) & Int(1 << 2) != 0 {
|
||||
serializeString(tone!, buffer: buffer, boxed: false)
|
||||
}
|
||||
return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("toLang", String(describing: toLang)), ("tone", String(describing: tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.TextWithEntities? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.TextWithEntities?
|
||||
if let signature = reader.readInt32() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue