InputMedia class sealed

This object represents the content of a media message to be sent. It should be one of

Implemented types
Available extensions
Annotations
  • @Freezed.new(fromJson: false, toJson: true, unionKey: "type")

Constructors

InputMedia.animation({@JsonKey.new(name: 'type') @Default.new(InputMediaType.animation) InputMediaType type, @JsonKey.new(name: 'media') @InputFileConverter() required InputFile media, @JsonKey.new(name: 'thumbnail') @InputFileConverter() InputFile? thumbnail, @JsonKey.new(name: 'caption') String? caption, @JsonKey.new(name: 'parse_mode') ParseMode? parseMode, @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities, @JsonKey.new(name: 'width') int? width, @JsonKey.new(name: 'height') int? height, @JsonKey.new(name: 'duration') int? duration, @JsonKey.new(name: 'has_spoiler') bool? hasSpoiler, @JsonKey.new(name: 'show_caption_above_media') bool? showCaptionAboveMedia})
Represents an animation to be sent
const
factory
InputMedia.audio({@JsonKey.new(name: 'type') @Default.new(InputMediaType.audio) InputMediaType type, @JsonKey.new(name: 'media') @InputFileConverter() required InputFile media, @JsonKey.new(name: 'thumbnail') @InputFileConverter() InputFile? thumbnail, @JsonKey.new(name: 'caption') String? caption, @JsonKey.new(name: 'parse_mode') ParseMode? parseMode, @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities, @JsonKey.new(name: 'duration') int? duration, @JsonKey.new(name: 'performer') String? performer, @JsonKey.new(name: 'title') String? title})
Represents an audio file to be treated as music to be sent.
const
factory
InputMedia.document({@JsonKey.new(name: 'type') @Default.new(InputMediaType.document) InputMediaType type, @JsonKey.new(name: 'media') @InputFileConverter() required InputFile media, @JsonKey.new(name: 'thumbnail') @InputFileConverter() InputFile? thumbnail, @JsonKey.new(name: 'caption') String? caption, @JsonKey.new(name: 'parse_mode') ParseMode? parseMode, @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities, @JsonKey.new(name: 'disable_content_type_detection') bool? disableContentTypeDetection})
Represents a document to be sent.
const
factory
InputMedia.fromJson(Map<String, Object?> json)
factory
InputMedia.photo({@JsonKey.new(name: 'type') @Default.new(InputMediaType.photo) InputMediaType type, @JsonKey.new(name: 'media') @InputFileConverter() required InputFile media, @JsonKey.new(name: 'caption') String? caption, @JsonKey.new(name: 'parse_mode') ParseMode? parseMode, @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities, @JsonKey.new(name: 'has_spoiler') bool? hasSpoiler, @JsonKey.new(name: 'show_caption_above_media') bool? showCaptionAboveMedia})
Represents a photo to be sent.
const
factory
InputMedia.video({@JsonKey.new(name: 'type') @Default.new(InputMediaType.video) InputMediaType type, @JsonKey.new(name: 'media') @InputFileConverter() required InputFile media, @JsonKey.new(name: 'thumbnail') @InputFileConverter() InputFile? thumbnail, @JsonKey.new(name: 'caption') String? caption, @JsonKey.new(name: 'parse_mode') ParseMode? parseMode, @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities, @JsonKey.new(name: 'width') int? width, @JsonKey.new(name: 'height') int? height, @JsonKey.new(name: 'duration') int? duration, @JsonKey.new(name: 'supports_streaming') bool? supportsStreaming, @JsonKey.new(name: 'has_spoiler') bool? hasSpoiler, @JsonKey.new(name: 'show_caption_above_media') bool? showCaptionAboveMedia, @JsonKey.new(name: 'start_timestamp') int? startTimestamp, @JsonKey.new(name: 'cover') @InputFileConverter() InputFile? cover})
Represents a video to be sent.
const
factory

Properties

caption → String?
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
no setterinherited
captionEntities → List<MessageEntity>?
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
no setterinherited
copyWith → $InputMediaCopyWith<InputMedia>
Create a copy of InputMedia with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
media → InputFile
The file to send
no setterinherited
parseMode → ParseMode?
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → InputMediaType
Type of input media.
no setterinherited

Methods

getInputFiles() → Iterable<InputFile?>
Returns an iterable of files
map<TResult extends Object?>({required TResult photo(InputMediaPhoto value), required TResult document(InputMediaDocument value), required TResult animation(InputMediaAnimation value), required TResult audio(InputMediaAudio value), required TResult video(InputMediaVideo value)}) → TResult

Available on InputMedia, provided by the InputMediaPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? photo(InputMediaPhoto value)?, TResult? document(InputMediaDocument value)?, TResult? animation(InputMediaAnimation value)?, TResult? audio(InputMediaAudio value)?, TResult? video(InputMediaVideo value)?}) → TResult?

Available on InputMedia, provided by the InputMediaPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult photo(InputMediaPhoto value)?, TResult document(InputMediaDocument value)?, TResult animation(InputMediaAnimation value)?, TResult audio(InputMediaAudio value)?, TResult video(InputMediaVideo value)?, required TResult orElse()}) → TResult

Available on InputMedia, provided by the InputMediaPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this InputMedia to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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