MessageGift class final

A regular gift was received or sent by the current user, or the current user was notified about a channel gift

Inheritance

Constructors

MessageGift({required Gift gift, MessageSender? senderId, required MessageSender receiverId, required String receivedGiftId, required FormattedText text, required int uniqueGiftNumber, required int sellStarCount, required int prepaidUpgradeStarCount, required bool isUpgradeSeparate, required bool isFromAuction, required bool isPrivate, required bool isSaved, required bool isPrepaidUpgrade, required bool canBeUpgraded, required bool canBeDeleted, required bool wasConverted, required bool wasUpgraded, required bool wasRefunded, required String upgradedReceivedGiftId, required String prepaidUpgradeHash})
A regular gift was received or sent by the current user, or the current user was notified about a channel gift
const
MessageGift.fromJson(Map<String, dynamic> json)
Parses a MessageGift from TDLib JSON.
factory

Properties

canBeDeleted → bool
True, if the gift can be deleted using deleteGift; only for the receiver of the gift
final
canBeUpgraded → bool
True, if the gift can be upgraded to a unique gift; only for the receiver of the gift
final
clientId → int?
Identifier of the TDLib client that sent this object, when known.
no setterinherited
extra → dynamic
"@extra" of the request this object answers; null for updates.
no setterinherited
gift → Gift
The gift
final
hashCode → int
The hash code for this object.
no setterinherited
isFromAuction → bool
True, if the message is a notification about a gift won on an auction
final
isPrepaidUpgrade → bool
True, if the message is about prepaid upgrade of the gift by another user
final
isPrivate → bool
True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
final
isSaved → bool
True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift
final
isUpgradeSeparate → bool
True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost
final
prepaidUpgradeHash → String
If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade
final
prepaidUpgradeStarCount → int
Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift
final
receivedGiftId → String
Unique identifier of the received gift for the current user; only for the receiver of the gift
final
receiverId → MessageSender
Receiver of the gift
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sellStarCount → int
Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver
final
senderId → MessageSender?
Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users
final
text → FormattedText
Message added to the gift
final
uniqueGiftNumber → int
Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned
final
upgradedReceivedGiftId → String
Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift
final
wasConverted → bool
True, if the gift was converted to Telegram Stars; only for the receiver of the gift
final
wasRefunded → bool
True, if the gift was refunded and isn't available anymore
final
wasUpgraded → bool
True, if the gift was upgraded to a unique gift
final

Methods

copyWith({Gift? gift, MessageSender? senderId()?, MessageSender? receiverId, String? receivedGiftId, FormattedText? text, int? uniqueGiftNumber, int? sellStarCount, int? prepaidUpgradeStarCount, bool? isUpgradeSeparate, bool? isFromAuction, bool? isPrivate, bool? isSaved, bool? isPrepaidUpgrade, bool? canBeUpgraded, bool? canBeDeleted, bool? wasConverted, bool? wasUpgraded, bool? wasRefunded, String? upgradedReceivedGiftId, String? prepaidUpgradeHash}) → MessageGift
Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.
override
getConstructor() → String
TDLib type name, e.g. updateNewMessage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this object to TDLib JSON.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

CONSTRUCTOR → const String
TDLib type name.