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
6980ca9397
commit
3a311f75bd
27 changed files with 254 additions and 130 deletions
|
|
@ -482,7 +482,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-1877932953] = { return Api.InputPrivacyRule.parse_inputPrivacyValueDisallowUsers($0) }
|
||||
dict[609840449] = { return Api.InputQuickReplyShortcut.parse_inputQuickReplyShortcut($0) }
|
||||
dict[18418929] = { return Api.InputQuickReplyShortcut.parse_inputQuickReplyShortcutId($0) }
|
||||
dict[-2036351472] = { return Api.InputReplyTo.parse_inputReplyToMessage($0) }
|
||||
dict[1003796418] = { return Api.InputReplyTo.parse_inputReplyToMessage($0) }
|
||||
dict[1775660101] = { return Api.InputReplyTo.parse_inputReplyToMonoForum($0) }
|
||||
dict[1484862010] = { return Api.InputReplyTo.parse_inputReplyToStory($0) }
|
||||
dict[-251549057] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftChat($0) }
|
||||
|
|
@ -621,6 +621,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[-6288180] = { return Api.MessageAction.parse_messageActionPaymentSentMe($0) }
|
||||
dict[-2132731265] = { return Api.MessageAction.parse_messageActionPhoneCall($0) }
|
||||
dict[-1799538451] = { return Api.MessageAction.parse_messageActionPinMessage($0) }
|
||||
dict[-1650340500] = { return Api.MessageAction.parse_messageActionPollAppendAnswer($0) }
|
||||
dict[-1341372510] = { return Api.MessageAction.parse_messageActionPrizeStars($0) }
|
||||
dict[827428507] = { return Api.MessageAction.parse_messageActionRequestedPeer($0) }
|
||||
dict[-1816979384] = { return Api.MessageAction.parse_messageActionRequestedPeerSentMe($0) }
|
||||
|
|
@ -697,7 +698,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[171155211] = { return Api.MessageReactions.parse_messageReactions($0) }
|
||||
dict[1269016922] = { return Api.MessageReactor.parse_messageReactor($0) }
|
||||
dict[-2083123262] = { return Api.MessageReplies.parse_messageReplies($0) }
|
||||
dict[1763137035] = { return Api.MessageReplyHeader.parse_messageReplyHeader($0) }
|
||||
dict[462937446] = { return Api.MessageReplyHeader.parse_messageReplyHeader($0) }
|
||||
dict[240843065] = { return Api.MessageReplyHeader.parse_messageReplyStoryHeader($0) }
|
||||
dict[2030298073] = { return Api.MessageReportOption.parse_messageReportOption($0) }
|
||||
dict[1163625789] = { return Api.MessageViews.parse_messageViews($0) }
|
||||
|
|
@ -713,6 +714,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[1458172132] = { return Api.MessagesFilter.parse_inputMessagesFilterPhotoVideo($0) }
|
||||
dict[-1777752804] = { return Api.MessagesFilter.parse_inputMessagesFilterPhotos($0) }
|
||||
dict[464520273] = { return Api.MessagesFilter.parse_inputMessagesFilterPinned($0) }
|
||||
dict[-97793782] = { return Api.MessagesFilter.parse_inputMessagesFilterPoll($0) }
|
||||
dict[-1253451181] = { return Api.MessagesFilter.parse_inputMessagesFilterRoundVideo($0) }
|
||||
dict[2054952868] = { return Api.MessagesFilter.parse_inputMessagesFilterRoundVoice($0) }
|
||||
dict[2129714567] = { return Api.MessagesFilter.parse_inputMessagesFilterUrl($0) }
|
||||
|
|
@ -814,7 +816,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||
dict[236446268] = { return Api.PhotoSize.parse_photoSizeEmpty($0) }
|
||||
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[-1203610647] = { return Api.Poll.parse_poll($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) }
|
||||
|
|
@ -1254,7 +1256,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[-1577103027] = { return Api.UserFull.parse_userFull($0) }
|
||||
dict[114026053] = { 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) }
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ public extension Api {
|
|||
public var quoteOffset: Int32?
|
||||
public var monoforumPeerId: Api.InputPeer?
|
||||
public var todoItemId: Int32?
|
||||
public init(flags: Int32, replyToMsgId: Int32, topMsgId: Int32?, replyToPeerId: Api.InputPeer?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, monoforumPeerId: Api.InputPeer?, todoItemId: Int32?) {
|
||||
public var pollOption: Buffer?
|
||||
public init(flags: Int32, replyToMsgId: Int32, topMsgId: Int32?, replyToPeerId: Api.InputPeer?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, monoforumPeerId: Api.InputPeer?, todoItemId: Int32?, pollOption: Buffer?) {
|
||||
self.flags = flags
|
||||
self.replyToMsgId = replyToMsgId
|
||||
self.topMsgId = topMsgId
|
||||
|
|
@ -93,9 +94,10 @@ public extension Api {
|
|||
self.quoteOffset = quoteOffset
|
||||
self.monoforumPeerId = monoforumPeerId
|
||||
self.todoItemId = todoItemId
|
||||
self.pollOption = pollOption
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("inputReplyToMessage", [("flags", self.flags as Any), ("replyToMsgId", self.replyToMsgId as Any), ("topMsgId", self.topMsgId as Any), ("replyToPeerId", self.replyToPeerId as Any), ("quoteText", self.quoteText as Any), ("quoteEntities", self.quoteEntities as Any), ("quoteOffset", self.quoteOffset as Any), ("monoforumPeerId", self.monoforumPeerId as Any), ("todoItemId", self.todoItemId as Any)])
|
||||
return ("inputReplyToMessage", [("flags", self.flags as Any), ("replyToMsgId", self.replyToMsgId as Any), ("topMsgId", self.topMsgId as Any), ("replyToPeerId", self.replyToPeerId as Any), ("quoteText", self.quoteText as Any), ("quoteEntities", self.quoteEntities as Any), ("quoteOffset", self.quoteOffset as Any), ("monoforumPeerId", self.monoforumPeerId as Any), ("todoItemId", self.todoItemId as Any), ("pollOption", self.pollOption as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_inputReplyToMonoForum: TypeConstructorDescription {
|
||||
|
|
@ -126,7 +128,7 @@ public extension Api {
|
|||
switch self {
|
||||
case .inputReplyToMessage(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-2036351472)
|
||||
buffer.appendInt32(1003796418)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.replyToMsgId, buffer: buffer, boxed: false)
|
||||
|
|
@ -155,6 +157,9 @@ public extension Api {
|
|||
if Int(_data.flags) & Int(1 << 6) != 0 {
|
||||
serializeInt32(_data.todoItemId!, buffer: buffer, boxed: false)
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 7) != 0 {
|
||||
serializeBytes(_data.pollOption!, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .inputReplyToMonoForum(let _data):
|
||||
if boxed {
|
||||
|
|
@ -175,7 +180,7 @@ public extension Api {
|
|||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .inputReplyToMessage(let _data):
|
||||
return ("inputReplyToMessage", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("topMsgId", _data.topMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("monoforumPeerId", _data.monoforumPeerId as Any), ("todoItemId", _data.todoItemId as Any)])
|
||||
return ("inputReplyToMessage", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("topMsgId", _data.topMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("monoforumPeerId", _data.monoforumPeerId as Any), ("todoItemId", _data.todoItemId as Any), ("pollOption", _data.pollOption as Any)])
|
||||
case .inputReplyToMonoForum(let _data):
|
||||
return ("inputReplyToMonoForum", [("monoforumPeerId", _data.monoforumPeerId as Any)])
|
||||
case .inputReplyToStory(let _data):
|
||||
|
|
@ -222,6 +227,10 @@ public extension Api {
|
|||
if Int(_1!) & Int(1 << 6) != 0 {
|
||||
_9 = reader.readInt32()
|
||||
}
|
||||
var _10: Buffer?
|
||||
if Int(_1!) & Int(1 << 7) != 0 {
|
||||
_10 = parseBytes(reader)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
|
|
@ -231,8 +240,9 @@ public extension Api {
|
|||
let _c7 = (Int(_1!) & Int(1 << 4) == 0) || _7 != nil
|
||||
let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil
|
||||
let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
|
||||
return Api.InputReplyTo.inputReplyToMessage(Cons_inputReplyToMessage(flags: _1!, replyToMsgId: _2!, topMsgId: _3, replyToPeerId: _4, quoteText: _5, quoteEntities: _6, quoteOffset: _7, monoforumPeerId: _8, todoItemId: _9))
|
||||
let _c10 = (Int(_1!) & Int(1 << 7) == 0) || _10 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||
return Api.InputReplyTo.inputReplyToMessage(Cons_inputReplyToMessage(flags: _1!, replyToMsgId: _2!, topMsgId: _3, replyToPeerId: _4, quoteText: _5, quoteEntities: _6, quoteOffset: _7, monoforumPeerId: _8, todoItemId: _9, pollOption: _10))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -1623,7 +1623,7 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum MessageAction: TypeConstructorDescription {
|
||||
indirect enum MessageAction: TypeConstructorDescription {
|
||||
public class Cons_messageActionBoostApply: TypeConstructorDescription {
|
||||
public var boosts: Int32
|
||||
public init(boosts: Int32) {
|
||||
|
|
@ -2071,6 +2071,15 @@ public extension Api {
|
|||
return ("messageActionPhoneCall", [("flags", self.flags as Any), ("callId", self.callId as Any), ("reason", self.reason as Any), ("duration", self.duration as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_messageActionPollAppendAnswer: TypeConstructorDescription {
|
||||
public var answer: Api.PollAnswer
|
||||
public init(answer: Api.PollAnswer) {
|
||||
self.answer = answer
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("messageActionPollAppendAnswer", [("answer", self.answer as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_messageActionPrizeStars: TypeConstructorDescription {
|
||||
public var flags: Int32
|
||||
public var stars: Int64
|
||||
|
|
@ -2419,6 +2428,7 @@ public extension Api {
|
|||
case messageActionPaymentSentMe(Cons_messageActionPaymentSentMe)
|
||||
case messageActionPhoneCall(Cons_messageActionPhoneCall)
|
||||
case messageActionPinMessage
|
||||
case messageActionPollAppendAnswer(Cons_messageActionPollAppendAnswer)
|
||||
case messageActionPrizeStars(Cons_messageActionPrizeStars)
|
||||
case messageActionRequestedPeer(Cons_messageActionRequestedPeer)
|
||||
case messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe)
|
||||
|
|
@ -2822,6 +2832,12 @@ public extension Api {
|
|||
buffer.appendInt32(-1799538451)
|
||||
}
|
||||
break
|
||||
case .messageActionPollAppendAnswer(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1650340500)
|
||||
}
|
||||
_data.answer.serialize(buffer, true)
|
||||
break
|
||||
case .messageActionPrizeStars(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1341372510)
|
||||
|
|
@ -3190,6 +3206,8 @@ public extension Api {
|
|||
return ("messageActionPhoneCall", [("flags", _data.flags as Any), ("callId", _data.callId as Any), ("reason", _data.reason as Any), ("duration", _data.duration as Any)])
|
||||
case .messageActionPinMessage:
|
||||
return ("messageActionPinMessage", [])
|
||||
case .messageActionPollAppendAnswer(let _data):
|
||||
return ("messageActionPollAppendAnswer", [("answer", _data.answer as Any)])
|
||||
case .messageActionPrizeStars(let _data):
|
||||
return ("messageActionPrizeStars", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("transactionId", _data.transactionId as Any), ("boostPeer", _data.boostPeer as Any), ("giveawayMsgId", _data.giveawayMsgId as Any)])
|
||||
case .messageActionRequestedPeer(let _data):
|
||||
|
|
@ -3942,6 +3960,19 @@ public extension Api {
|
|||
public static func parse_messageActionPinMessage(_ reader: BufferReader) -> MessageAction? {
|
||||
return Api.MessageAction.messageActionPinMessage
|
||||
}
|
||||
public static func parse_messageActionPollAppendAnswer(_ reader: BufferReader) -> MessageAction? {
|
||||
var _1: Api.PollAnswer?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.PollAnswer
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.MessageAction.messageActionPollAppendAnswer(Cons_messageActionPollAppendAnswer(answer: _1!))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_messageActionPrizeStars(_ reader: BufferReader) -> MessageAction? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
|
|
|
|||
|
|
@ -523,7 +523,8 @@ public extension Api {
|
|||
public var quoteEntities: [Api.MessageEntity]?
|
||||
public var quoteOffset: Int32?
|
||||
public var todoItemId: Int32?
|
||||
public init(flags: Int32, replyToMsgId: Int32?, replyToPeerId: Api.Peer?, replyFrom: Api.MessageFwdHeader?, replyMedia: Api.MessageMedia?, replyToTopId: Int32?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, todoItemId: Int32?) {
|
||||
public var pollOption: Buffer?
|
||||
public init(flags: Int32, replyToMsgId: Int32?, replyToPeerId: Api.Peer?, replyFrom: Api.MessageFwdHeader?, replyMedia: Api.MessageMedia?, replyToTopId: Int32?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, todoItemId: Int32?, pollOption: Buffer?) {
|
||||
self.flags = flags
|
||||
self.replyToMsgId = replyToMsgId
|
||||
self.replyToPeerId = replyToPeerId
|
||||
|
|
@ -534,9 +535,10 @@ public extension Api {
|
|||
self.quoteEntities = quoteEntities
|
||||
self.quoteOffset = quoteOffset
|
||||
self.todoItemId = todoItemId
|
||||
self.pollOption = pollOption
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("messageReplyHeader", [("flags", self.flags as Any), ("replyToMsgId", self.replyToMsgId as Any), ("replyToPeerId", self.replyToPeerId as Any), ("replyFrom", self.replyFrom as Any), ("replyMedia", self.replyMedia as Any), ("replyToTopId", self.replyToTopId as Any), ("quoteText", self.quoteText as Any), ("quoteEntities", self.quoteEntities as Any), ("quoteOffset", self.quoteOffset as Any), ("todoItemId", self.todoItemId as Any)])
|
||||
return ("messageReplyHeader", [("flags", self.flags as Any), ("replyToMsgId", self.replyToMsgId as Any), ("replyToPeerId", self.replyToPeerId as Any), ("replyFrom", self.replyFrom as Any), ("replyMedia", self.replyMedia as Any), ("replyToTopId", self.replyToTopId as Any), ("quoteText", self.quoteText as Any), ("quoteEntities", self.quoteEntities as Any), ("quoteOffset", self.quoteOffset as Any), ("todoItemId", self.todoItemId as Any), ("pollOption", self.pollOption as Any)])
|
||||
}
|
||||
}
|
||||
public class Cons_messageReplyStoryHeader: TypeConstructorDescription {
|
||||
|
|
@ -557,7 +559,7 @@ public extension Api {
|
|||
switch self {
|
||||
case .messageReplyHeader(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(1763137035)
|
||||
buffer.appendInt32(462937446)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
if Int(_data.flags) & Int(1 << 4) != 0 {
|
||||
|
|
@ -591,6 +593,9 @@ public extension Api {
|
|||
if Int(_data.flags) & Int(1 << 11) != 0 {
|
||||
serializeInt32(_data.todoItemId!, buffer: buffer, boxed: false)
|
||||
}
|
||||
if Int(_data.flags) & Int(1 << 12) != 0 {
|
||||
serializeBytes(_data.pollOption!, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .messageReplyStoryHeader(let _data):
|
||||
if boxed {
|
||||
|
|
@ -605,7 +610,7 @@ public extension Api {
|
|||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .messageReplyHeader(let _data):
|
||||
return ("messageReplyHeader", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("replyFrom", _data.replyFrom as Any), ("replyMedia", _data.replyMedia as Any), ("replyToTopId", _data.replyToTopId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("todoItemId", _data.todoItemId as Any)])
|
||||
return ("messageReplyHeader", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("replyFrom", _data.replyFrom as Any), ("replyMedia", _data.replyMedia as Any), ("replyToTopId", _data.replyToTopId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("todoItemId", _data.todoItemId as Any), ("pollOption", _data.pollOption as Any)])
|
||||
case .messageReplyStoryHeader(let _data):
|
||||
return ("messageReplyStoryHeader", [("peer", _data.peer as Any), ("storyId", _data.storyId as Any)])
|
||||
}
|
||||
|
|
@ -658,6 +663,10 @@ public extension Api {
|
|||
if Int(_1!) & Int(1 << 11) != 0 {
|
||||
_10 = reader.readInt32()
|
||||
}
|
||||
var _11: Buffer?
|
||||
if Int(_1!) & Int(1 << 12) != 0 {
|
||||
_11 = parseBytes(reader)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
||||
|
|
@ -668,8 +677,9 @@ public extension Api {
|
|||
let _c8 = (Int(_1!) & Int(1 << 7) == 0) || _8 != nil
|
||||
let _c9 = (Int(_1!) & Int(1 << 10) == 0) || _9 != nil
|
||||
let _c10 = (Int(_1!) & Int(1 << 11) == 0) || _10 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||
return Api.MessageReplyHeader.messageReplyHeader(Cons_messageReplyHeader(flags: _1!, replyToMsgId: _2, replyToPeerId: _3, replyFrom: _4, replyMedia: _5, replyToTopId: _6, quoteText: _7, quoteEntities: _8, quoteOffset: _9, todoItemId: _10))
|
||||
let _c11 = (Int(_1!) & Int(1 << 12) == 0) || _11 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 {
|
||||
return Api.MessageReplyHeader.messageReplyHeader(Cons_messageReplyHeader(flags: _1!, replyToMsgId: _2, replyToPeerId: _3, replyFrom: _4, replyMedia: _5, replyToTopId: _6, quoteText: _7, quoteEntities: _8, quoteOffset: _9, todoItemId: _10, pollOption: _11))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
@ -842,6 +852,7 @@ public extension Api {
|
|||
case inputMessagesFilterPhotoVideo
|
||||
case inputMessagesFilterPhotos
|
||||
case inputMessagesFilterPinned
|
||||
case inputMessagesFilterPoll
|
||||
case inputMessagesFilterRoundVideo
|
||||
case inputMessagesFilterRoundVoice
|
||||
case inputMessagesFilterUrl
|
||||
|
|
@ -911,6 +922,11 @@ public extension Api {
|
|||
buffer.appendInt32(464520273)
|
||||
}
|
||||
break
|
||||
case .inputMessagesFilterPoll:
|
||||
if boxed {
|
||||
buffer.appendInt32(-97793782)
|
||||
}
|
||||
break
|
||||
case .inputMessagesFilterRoundVideo:
|
||||
if boxed {
|
||||
buffer.appendInt32(-1253451181)
|
||||
|
|
@ -965,6 +981,8 @@ public extension Api {
|
|||
return ("inputMessagesFilterPhotos", [])
|
||||
case .inputMessagesFilterPinned:
|
||||
return ("inputMessagesFilterPinned", [])
|
||||
case .inputMessagesFilterPoll:
|
||||
return ("inputMessagesFilterPoll", [])
|
||||
case .inputMessagesFilterRoundVideo:
|
||||
return ("inputMessagesFilterRoundVideo", [])
|
||||
case .inputMessagesFilterRoundVoice:
|
||||
|
|
@ -1022,6 +1040,9 @@ public extension Api {
|
|||
public static func parse_inputMessagesFilterPinned(_ reader: BufferReader) -> MessagesFilter? {
|
||||
return Api.MessagesFilter.inputMessagesFilterPinned
|
||||
}
|
||||
public static func parse_inputMessagesFilterPoll(_ reader: BufferReader) -> MessagesFilter? {
|
||||
return Api.MessagesFilter.inputMessagesFilterPoll
|
||||
}
|
||||
public static func parse_inputMessagesFilterRoundVideo(_ reader: BufferReader) -> MessagesFilter? {
|
||||
return Api.MessagesFilter.inputMessagesFilterRoundVideo
|
||||
}
|
||||
|
|
@ -1173,59 +1194,3 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum NearestDc: TypeConstructorDescription {
|
||||
public class Cons_nearestDc: TypeConstructorDescription {
|
||||
public var country: String
|
||||
public var thisDc: Int32
|
||||
public var nearestDc: Int32
|
||||
public init(country: String, thisDc: Int32, nearestDc: Int32) {
|
||||
self.country = country
|
||||
self.thisDc = thisDc
|
||||
self.nearestDc = nearestDc
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("nearestDc", [("country", self.country as Any), ("thisDc", self.thisDc as Any), ("nearestDc", self.nearestDc as Any)])
|
||||
}
|
||||
}
|
||||
case nearestDc(Cons_nearestDc)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .nearestDc(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1910892683)
|
||||
}
|
||||
serializeString(_data.country, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.thisDc, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.nearestDc, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .nearestDc(let _data):
|
||||
return ("nearestDc", [("country", _data.country as Any), ("thisDc", _data.thisDc as Any), ("nearestDc", _data.nearestDc as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_nearestDc(_ reader: BufferReader) -> NearestDc? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
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.NearestDc.nearestDc(Cons_nearestDc(country: _1!, thisDc: _2!, nearestDc: _3!))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,59 @@
|
|||
public extension Api {
|
||||
enum NearestDc: TypeConstructorDescription {
|
||||
public class Cons_nearestDc: TypeConstructorDescription {
|
||||
public var country: String
|
||||
public var thisDc: Int32
|
||||
public var nearestDc: Int32
|
||||
public init(country: String, thisDc: Int32, nearestDc: Int32) {
|
||||
self.country = country
|
||||
self.thisDc = thisDc
|
||||
self.nearestDc = nearestDc
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("nearestDc", [("country", self.country as Any), ("thisDc", self.thisDc as Any), ("nearestDc", self.nearestDc as Any)])
|
||||
}
|
||||
}
|
||||
case nearestDc(Cons_nearestDc)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .nearestDc(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1910892683)
|
||||
}
|
||||
serializeString(_data.country, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.thisDc, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.nearestDc, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .nearestDc(let _data):
|
||||
return ("nearestDc", [("country", _data.country as Any), ("thisDc", _data.thisDc as Any), ("nearestDc", _data.nearestDc as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_nearestDc(_ reader: BufferReader) -> NearestDc? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
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.NearestDc.nearestDc(Cons_nearestDc(country: _1!, thisDc: _2!, nearestDc: _3!))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum NotificationSound: TypeConstructorDescription {
|
||||
public class Cons_notificationSoundLocal: TypeConstructorDescription {
|
||||
|
|
|
|||
|
|
@ -694,16 +694,18 @@ public extension Api {
|
|||
public var answers: [Api.PollAnswer]
|
||||
public var closePeriod: Int32?
|
||||
public var closeDate: Int32?
|
||||
public init(id: Int64, flags: Int32, question: Api.TextWithEntities, answers: [Api.PollAnswer], closePeriod: Int32?, closeDate: Int32?) {
|
||||
public var hash: Int64
|
||||
public init(id: Int64, flags: Int32, question: Api.TextWithEntities, answers: [Api.PollAnswer], closePeriod: Int32?, closeDate: Int32?, hash: Int64) {
|
||||
self.id = id
|
||||
self.flags = flags
|
||||
self.question = question
|
||||
self.answers = answers
|
||||
self.closePeriod = closePeriod
|
||||
self.closeDate = closeDate
|
||||
self.hash = hash
|
||||
}
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
return ("poll", [("id", self.id as Any), ("flags", self.flags as Any), ("question", self.question as Any), ("answers", self.answers as Any), ("closePeriod", self.closePeriod as Any), ("closeDate", self.closeDate as Any)])
|
||||
return ("poll", [("id", self.id as Any), ("flags", self.flags as Any), ("question", self.question as Any), ("answers", self.answers as Any), ("closePeriod", self.closePeriod as Any), ("closeDate", self.closeDate as Any), ("hash", self.hash as Any)])
|
||||
}
|
||||
}
|
||||
case poll(Cons_poll)
|
||||
|
|
@ -712,7 +714,7 @@ public extension Api {
|
|||
switch self {
|
||||
case .poll(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(1484026161)
|
||||
buffer.appendInt32(-1203610647)
|
||||
}
|
||||
serializeInt64(_data.id, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
|
|
@ -728,6 +730,7 @@ public extension Api {
|
|||
if Int(_data.flags) & Int(1 << 5) != 0 {
|
||||
serializeInt32(_data.closeDate!, buffer: buffer, boxed: false)
|
||||
}
|
||||
serializeInt64(_data.hash, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -735,7 +738,7 @@ public extension Api {
|
|||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .poll(let _data):
|
||||
return ("poll", [("id", _data.id as Any), ("flags", _data.flags as Any), ("question", _data.question as Any), ("answers", _data.answers as Any), ("closePeriod", _data.closePeriod as Any), ("closeDate", _data.closeDate as Any)])
|
||||
return ("poll", [("id", _data.id as Any), ("flags", _data.flags as Any), ("question", _data.question as Any), ("answers", _data.answers as Any), ("closePeriod", _data.closePeriod as Any), ("closeDate", _data.closeDate as Any), ("hash", _data.hash as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -760,14 +763,17 @@ public extension Api {
|
|||
if Int(_2!) & Int(1 << 5) != 0 {
|
||||
_6 = reader.readInt32()
|
||||
}
|
||||
var _7: Int64?
|
||||
_7 = reader.readInt64()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = (Int(_2!) & Int(1 << 4) == 0) || _5 != nil
|
||||
let _c6 = (Int(_2!) & Int(1 << 5) == 0) || _6 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
||||
return Api.Poll.poll(Cons_poll(id: _1!, flags: _2!, question: _3!, answers: _4!, closePeriod: _5, closeDate: _6))
|
||||
let _c7 = _7 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
||||
return Api.Poll.poll(Cons_poll(id: _1!, flags: _2!, question: _3!, answers: _4!, closePeriod: _5, closeDate: _6, hash: _7!))
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -1124,7 +1124,7 @@ public extension Api {
|
|||
switch self {
|
||||
case .userFull(let _data):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1577103027)
|
||||
buffer.appendInt32(114026053)
|
||||
}
|
||||
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(_data.flags2, buffer: buffer, boxed: false)
|
||||
|
|
@ -1231,7 +1231,7 @@ public extension Api {
|
|||
if Int(_data.flags2) & Int(1 << 22) != 0 {
|
||||
_data.note!.serialize(buffer, true)
|
||||
}
|
||||
if Int(_data.flags2) & Int(1 << 23) != 0 {
|
||||
if Int(_data.flags2) & Int(1 << 25) != 0 {
|
||||
serializeInt64(_data.botManagerId!, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
|
|
@ -1441,7 +1441,7 @@ public extension Api {
|
|||
}
|
||||
}
|
||||
var _40: Int64?
|
||||
if Int(_2!) & Int(1 << 23) != 0 {
|
||||
if Int(_2!) & Int(1 << 25) != 0 {
|
||||
_40 = reader.readInt64()
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
|
|
@ -1483,7 +1483,7 @@ 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
|
||||
let _c40 = (Int(_2!) & Int(1 << 23) == 0) || _40 != nil
|
||||
let _c40 = (Int(_2!) & Int(1 << 25) == 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))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2630,12 +2630,12 @@ public extension Api.functions.bots {
|
|||
}
|
||||
}
|
||||
public extension Api.functions.bots {
|
||||
static func exportBotToken(botId: Int64, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.bots.ExportedBotToken>) {
|
||||
static func exportBotToken(bot: Api.InputUser, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.bots.ExportedBotToken>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(6533257)
|
||||
serializeInt64(botId, buffer: buffer, boxed: false)
|
||||
buffer.appendInt32(-1123182101)
|
||||
bot.serialize(buffer, true)
|
||||
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
|
||||
return (FunctionDescription(name: "bots.exportBotToken", parameters: [("bot", String(describing: bot)), ("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() {
|
||||
|
|
@ -5495,6 +5495,28 @@ public extension Api.functions.messages {
|
|||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.messages {
|
||||
static func composeMessageWithAI(flags: Int32, text: Api.TextWithEntities, translateToLang: String?, changeTone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.TextWithEntities>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-1080571914)
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
text.serialize(buffer, true)
|
||||
if Int(flags) & Int(1 << 1) != 0 {
|
||||
serializeString(translateToLang!, buffer: buffer, boxed: false)
|
||||
}
|
||||
if Int(flags) & Int(1 << 2) != 0 {
|
||||
serializeString(changeTone!, buffer: buffer, boxed: false)
|
||||
}
|
||||
return (FunctionDescription(name: "messages.composeMessageWithAI", parameters: [("flags", String(describing: flags)), ("text", String(describing: text)), ("translateToLang", String(describing: translateToLang)), ("changeTone", String(describing: changeTone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.TextWithEntities? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.TextWithEntities?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.messages {
|
||||
static func createChat(flags: Int32, users: [Api.InputUser], title: String, ttlPeriod: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.messages.InvitedUsers>) {
|
||||
let buffer = Buffer()
|
||||
|
|
@ -7283,12 +7305,13 @@ public extension Api.functions.messages {
|
|||
}
|
||||
}
|
||||
public extension Api.functions.messages {
|
||||
static func getPollResults(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
static func getPollResults(peer: Api.InputPeer, msgId: Int32, pollHash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(1941660731)
|
||||
buffer.appendInt32(-308026565)
|
||||
peer.serialize(buffer, true)
|
||||
serializeInt32(msgId, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
serializeInt64(pollHash, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("pollHash", String(describing: pollHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Updates?
|
||||
if let signature = reader.readInt32() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue