BotsUpdateStarRefProgram.deserialize constructor
BotsUpdateStarRefProgram.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory BotsUpdateStarRefProgram.deserialize(BinaryReader reader) {
// Read [BotsUpdateStarRefProgram] fields.
final flags = reader.readInt32();
final bot = reader.readObject() as InputUserBase;
final commissionPermille = reader.readInt32();
final hasDurationMonthsField = (flags & 1) != 0;
final durationMonths = hasDurationMonthsField ? reader.readInt32() : null;
// Construct [BotsUpdateStarRefProgram] object.
final returnValue = BotsUpdateStarRefProgram(
bot: bot,
commissionPermille: commissionPermille,
durationMonths: durationMonths,
);
// Now return the deserialized [BotsUpdateStarRefProgram].
return returnValue;
}