SponsoredMessage class final
Describes a sponsored message
Constructors
- SponsoredMessage({required int messageId, required bool isRecommended, required bool canBeReported, required MessageContent content, required AdvertisementSponsor sponsor, required String title, required String buttonText, required int accentColorId, required int backgroundCustomEmojiId, required String additionalInfo})
-
Describes a sponsored message
const
-
SponsoredMessage.fromJson(Map<
String, dynamic> json) -
Parses a SponsoredMessage from TDLib JSON.
factory
Properties
- accentColorId → int
-
Identifier of the accent color for title, button text and message background
final
- additionalInfo → String
-
If non-empty, additional information about the sponsored message to be shown along with the message
final
- backgroundCustomEmojiId → int
-
Identifier of a custom emoji to be shown on the message background; 0 if none
final
-
Text for the message action button
final
- canBeReported → bool
-
True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage
final
- clientId → int?
-
Identifier of the TDLib client that sent this object, when known.
no setterinherited
- content → MessageContent
-
Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen. The content must be fully downloaded before the message is shown
final
- extra → dynamic
-
"@extra" of the request this object answers; null for updates.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRecommended → bool
-
True, if the message needs to be labeled as "recommended" instead of "sponsored"
final
- messageId → int
-
Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sponsor → AdvertisementSponsor
-
Information about the sponsor of the message
final
- title → String
-
Title of the sponsored message
final
Methods
-
copyWith(
{int? messageId, bool? isRecommended, bool? canBeReported, MessageContent? content, AdvertisementSponsor? sponsor, String? title, String? buttonText, int? accentColorId, int? backgroundCustomEmojiId, String? additionalInfo}) → SponsoredMessage -
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g.
field: () => nullto clear it. -
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.