InputMessageContent.sharedWidget constructor

const InputMessageContent.sharedWidget({
  1. @JsonKey.new(name: 'widget_id') required String widgetId,
  2. @JsonKey.new(name: 'chat_data') String? chatData,
  3. @JsonKey.new(name: 'caption') String? caption,
  4. @JsonKey.new(name: 'parse_mode') ParseMode? parseMode,
  5. @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities,
  6. @JsonKey.new(name: 'show_caption_above_media') bool? showCaptionAboveMedia,
})

An existing shared widget to send as the result of an inline query.

Inline widget results are currently available only in the Telegram test environment.

Implementation

const factory InputMessageContent.sharedWidget({
  /// Identifier of the shared widget created by the bot.
  @JsonKey(name: 'widget_id') required final String widgetId,

  /// Data specific to the message, up to 1024 bytes.
  @JsonKey(name: 'chat_data') final String? chatData,

  /// Widget caption, up to 1024 characters after parsing entities.
  @JsonKey(name: 'caption') final String? caption,

  /// Mode for parsing entities in the caption.
  @JsonKey(name: 'parse_mode') final ParseMode? parseMode,

  /// Caption entities to use instead of a parse mode.
  @JsonKey(name: 'caption_entities')
  final List<MessageEntity>? captionEntities,

  /// Whether to show the caption above the widget.
  @JsonKey(name: 'show_caption_above_media')
  final bool? showCaptionAboveMedia,
}) = InputSharedWidgetMessageContent;