MessagesSetBotPrecheckoutResults.deserialize constructor

MessagesSetBotPrecheckoutResults.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory MessagesSetBotPrecheckoutResults.deserialize(BinaryReader reader) {
  // Read [MessagesSetBotPrecheckoutResults] fields.
  final flags = reader.readInt32();
  final success = (flags & 2) != 0;
  final queryId = reader.readInt64();
  final hasErrorField = (flags & 1) != 0;
  final error = hasErrorField ? reader.readString() : null;

  // Construct [MessagesSetBotPrecheckoutResults] object.
  final returnValue = MessagesSetBotPrecheckoutResults(
    success: success,
    queryId: queryId,
    error: error,
  );

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