ChatBoostSource class sealed
This object describes the source of a chat boost. It can be one of
- ChatBoostSourcePremium
- ChatBoostSourceGiftCode
- ChatBoostSourceGiveaway
- Annotations
-
- @Freezed(unionKey: 'source', unionValueCase: FreezedUnionCase.snake)
Constructors
-
ChatBoostSource.fromJson(Map<
String, dynamic> json) -
factory
- ChatBoostSource.giftCode({@JsonKey(name: 'source') @Default(ChatBoostSourceType.giftCode) ChatBoostSourceType source, @JsonKey(name: 'user') required User user})
-
The boost was obtained by the creation of Telegram Premium gift codes to
boost a chat. Each such code boosts the chat 4 times for the duration of
the corresponding Telegram Premium subscription.
constfactory
- ChatBoostSource.giveaway({@JsonKey(name: 'source') @Default(ChatBoostSourceType.giveaway) ChatBoostSourceType source, @JsonKey(name: 'giveaway_message_id') required int giveawayMessageId, @JsonKey(name: 'user') User? user, @JsonKey(name: 'prize_star_count') int? prizeStarCount, @JsonKey(name: 'is_unclaimed') bool? isUnclaimed})
-
The boost was obtained by the creation of a Telegram Premium or a Telegram
Star giveaway. This boosts the chat 4 times for the duration of the
corresponding Telegram Premium subscription for Telegram Premium giveaways
and prize_star_count / 500 times for one year for Telegram Star
giveaways.
constfactory
-
The boost was obtained by subscribing to Telegram Premium or by gifting a
Telegram Premium subscription to another user.
constfactory
Properties
-
copyWith
→ $ChatBoostSourceCopyWith<
ChatBoostSource> -
Create a copy of ChatBoostSource
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → ChatBoostSourceType
-
Source of the boost, always "premium"
no setterinherited
- user → User?
-
User that boosted the chat
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this ChatBoostSource to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited