InputMedia class sealed

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

Annotations
  • @Freezed(fromJson: false, toJson: true)

Constructors

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

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