SponsoredMessage class final
Describes a sponsored message
- Inheritance
- Available extensions
- Annotations
-
- @immutable
Constructors
- SponsoredMessage({required int messageId, required bool isRecommended, required bool canBeReported, MessageContent? content, AdvertisementSponsor? sponsor, required String title, required String buttonText, required int accentColorId, required int backgroundCustomEmojiId, required String additionalInfo})
Properties
- accentColorId → int
-
accentColorId Identifier of the accent color for title, button text and
message background
final
- additionalInfo → String
-
additionalInfo If non-empty, additional information about the sponsored
message to be shown along with the message
final
- backgroundCustomEmojiId → int
-
backgroundCustomEmojiId Identifier of a custom emoji to be shown on the
message background; 0 if none
final
-
buttonText Text for the message action button
final
- canBeReported → bool
-
canBeReported True, if the message can be reported to Telegram
moderators through reportChatSponsoredMessage
final
- content → MessageContent?
-
content 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
- hashCode → int
-
The hash code for this object.
no setteroverride
- isRecommended → bool
-
isRecommended True, if the message needs to be labeled as "recommended"
instead of "sponsored"
final
- messageId → int
-
messageId 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?
-
sponsor Information about the sponsor of the message
final
- title → String
-
title 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 -
Available on SponsoredMessage, provided by the SponsoredMessageExtensions extension
-
getConstructor(
) → String -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
fromJson(
Map< String, dynamic> ? json) → SponsoredMessage?
Constants
- constructor → const String