MessageReactionUpdated.fromJson constructor

MessageReactionUpdated.fromJson(
  1. Map<String, dynamic> json
)

Creates a MessageReactionUpdated object from JSON object.

Implementation

factory MessageReactionUpdated.fromJson(Map<String, dynamic> json) {
  return MessageReactionUpdated(
    chat: Chat.fromJson(json['chat']),
    messageId: json['message_id'],
    user: json['user'] != null ? User.fromJson(json['user']) : null,
    actorChat:
        json['actor_chat'] != null ? Chat.fromJson(json['actor_chat']) : null,
    date: json['date'],
    oldReaction: (json['old_reaction'] as List)
        .map((e) => ReactionType.fromJson(e))
        .toList(),
    newReaction: (json['new_reaction'] as List)
        .map((e) => ReactionType.fromJson(e))
        .toList(),
  );
}