UpdateChannelPinnedTopics.deserialize constructor

UpdateChannelPinnedTopics.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory UpdateChannelPinnedTopics.deserialize(BinaryReader reader) {
  // Read [UpdateChannelPinnedTopics] fields.
  final flags = reader.readInt32();
  final channelId = reader.readInt64();
  final hasOrderField = (flags & 1) != 0;
  final order = hasOrderField ? reader.readVectorInt32() : null;

  // Construct [UpdateChannelPinnedTopics] object.
  final returnValue = UpdateChannelPinnedTopics(
    channelId: channelId,
    order: order,
  );

  // Now return the deserialized [UpdateChannelPinnedTopics].
  return returnValue;
}