ChatMember.restricted constructor

const ChatMember.restricted({
  1. @Default(ChatMemberStatus.restricted) @JsonKey(name: 'status') ChatMemberStatus status,
  2. @JsonKey(name: 'user') required User user,
  3. @JsonKey(name: 'is_member') required bool isMember,
  4. @JsonKey(name: 'can_send_messages') required bool canSendMessages,
  5. @JsonKey(name: 'can_send_audios') required bool canSendAudios,
  6. @JsonKey(name: 'can_send_documents') required bool canSendDocuments,
  7. @JsonKey(name: 'can_send_photos') required bool canSendPhotos,
  8. @JsonKey(name: 'can_send_videos') required bool canSendVideos,
  9. @JsonKey(name: 'can_send_video_notes') required bool canSendVideoNotes,
  10. @JsonKey(name: 'can_send_voice_notes') required bool canSendVoiceNotes,
  11. @JsonKey(name: 'can_send_polls') required bool canSendPolls,
  12. @JsonKey(name: 'can_send_other_messages') required bool canSendOtherMessages,
  13. @JsonKey(name: 'can_add_web_page_previews') required bool canAddWebPagePreviews,
  14. @JsonKey(name: 'can_change_info') required bool canChangeInfo,
  15. @JsonKey(name: 'can_invite_users') required bool canInviteUsers,
  16. @JsonKey(name: 'can_pin_messages') required bool canPinMessages,
  17. @JsonKey(name: 'can_manage_topics') required bool canManageTopics,
  18. @JsonKey(name: 'until_date') required int untilDate,
})

Represents a chat member that is under certain restrictions in the chat. Supergroups only.

The status of this member is always "restricted".

Implementation

const factory ChatMember.restricted({
  /// The member's status in the chat
  @Default(ChatMemberStatus.restricted)
  @JsonKey(name: 'status')
  ChatMemberStatus status,

  /// Information about the user
  @JsonKey(name: 'user') required User user,

  /// True, if the user is a member of the chat at the moment of the request
  @JsonKey(name: 'is_member') required bool isMember,

  /// True, if the user is allowed to send text messages, contacts, giveaways,
  /// giveaway winners, invoices, locations and venues
  @JsonKey(name: 'can_send_messages') required bool canSendMessages,

  /// True, if the user is allowed to send audios
  @JsonKey(name: 'can_send_audios') required bool canSendAudios,

  /// True, if the user is allowed to send documents
  @JsonKey(name: 'can_send_documents') required bool canSendDocuments,

  /// True, if the user is allowed to send photos
  @JsonKey(name: 'can_send_photos') required bool canSendPhotos,

  /// True, if the user is allowed to send videos
  @JsonKey(name: 'can_send_videos') required bool canSendVideos,

  /// True, if the user is allowed to send video notes
  @JsonKey(name: 'can_send_video_notes') required bool canSendVideoNotes,

  /// True, if the user is allowed to send voice notes
  @JsonKey(name: 'can_send_voice_notes') required bool canSendVoiceNotes,

  /// True, if the user is allowed to send polls
  @JsonKey(name: 'can_send_polls') required bool canSendPolls,

  /// True, if the user is allowed to send animations, games, stickers and use
  /// inline bots
  @JsonKey(name: 'can_send_other_messages')
  required bool canSendOtherMessages,

  /// True, if the user is allowed to add web page previews to their messages
  @JsonKey(name: 'can_add_web_page_previews')
  required bool canAddWebPagePreviews,

  /// True, if the user is allowed to change the chat title, photo and other
  /// settings
  @JsonKey(name: 'can_change_info') required bool canChangeInfo,

  /// True, if the user is allowed to invite new users to the chat
  @JsonKey(name: 'can_invite_users') required bool canInviteUsers,

  /// True, if the user is allowed to pin messages
  @JsonKey(name: 'can_pin_messages') required bool canPinMessages,

  /// True, if the user is allowed to create forum topics
  @JsonKey(name: 'can_manage_topics') required bool canManageTopics,

  /// Date when restrictions will be lifted for this user; Unix time. If 0,
  /// then the user is restricted forever
  @JsonKey(name: 'until_date') required int untilDate,
}) = ChatMemberRestricted;