UpdateBotInlineQuery.deserialize constructor

UpdateBotInlineQuery.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory UpdateBotInlineQuery.deserialize(BinaryReader reader) {
  // Read [UpdateBotInlineQuery] fields.
  final flags = reader.readInt32();
  final queryId = reader.readInt64();
  final userId = reader.readInt64();
  final query = reader.readString();
  final hasGeoField = (flags & 1) != 0;
  final geo = hasGeoField ? reader.readObject() as GeoPointBase : null;
  final hasPeerTypeField = (flags & 2) != 0;
  final peerType = hasPeerTypeField
      ? reader.readObject() as InlineQueryPeerTypeBase
      : null;
  final offset = reader.readString();

  // Construct [UpdateBotInlineQuery] object.
  final returnValue = UpdateBotInlineQuery(
    queryId: queryId,
    userId: userId,
    query: query,
    geo: geo,
    peerType: peerType,
    offset: offset,
  );

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