toJson method

Encodes inline content for the Bot API.

Implementation

@override
Map<String, Object> toJson(InputMessageContent data) {
  // Telegram identifies inline content by its fields, so the Freezed union
  // discriminator must not be sent over the wire.
  final json = data.toJson()..remove('runtimeType');
  return json.cast<String, Object>();
}