toJson method

Map<String, dynamic> toJson()

Converts a ChatPermissions to a Map for JSON encoding.

Implementation

Map<String, dynamic> toJson() {
  return {
    'can_send_messages': canSendMessages,
    'can_send_polls': canSendPolls,
    'can_send_other_messages': canSendOtherMessages,
    'can_add_web_page_previews': canAddWebPagePreviews,
    'can_change_info': canChangeInfo,
    'can_invite_users': canInviteUsers,
    'can_pin_messages': canPinMessages,
    'can_manage_topics': canManageTopics,
    'can_send_audios': canSendAudios,
    'can_send_documents': canSendDocuments,
    'can_send_photos': canSendPhotos,
    'can_send_videos': canSendVideos,
    'can_send_video_notes': canSendVideoNotes,
    'can_send_voice_notes': canSendVoiceNotes,
  }..removeWhere(_nullFilter);
}