ChatMember.administrator constructor

const ChatMember.administrator({
  1. @Default(ChatMemberStatus.administrator) @JsonKey(name: 'status') ChatMemberStatus status,
  2. @JsonKey(name: 'user') required User user,
  3. @JsonKey(name: 'can_be_edited') required bool canBeEdited,
  4. @JsonKey(name: 'is_anonymous') required bool isAnonymous,
  5. @JsonKey(name: 'can_manage_chat') required bool canManageChat,
  6. @JsonKey(name: 'can_delete_messages') required bool canDeleteMessages,
  7. @JsonKey(name: 'can_manage_video_chats') required bool canManageVideoChats,
  8. @JsonKey(name: 'can_restrict_members') required bool canRestrictMembers,
  9. @JsonKey(name: 'can_promote_members') required bool canPromoteMembers,
  10. @JsonKey(name: 'can_change_info') required bool canChangeInfo,
  11. @JsonKey(name: 'can_invite_users') required bool canInviteUsers,
  12. @JsonKey(name: 'can_post_stories') required bool canPostStories,
  13. @JsonKey(name: 'can_edit_stories') required bool canEditStories,
  14. @JsonKey(name: 'can_delete_stories') required bool canDeleteStories,
  15. @JsonKey(name: 'can_post_messages') bool? canPostMessages,
  16. @JsonKey(name: 'can_edit_messages') bool? canEditMessages,
  17. @JsonKey(name: 'can_pin_messages') bool? canPinMessages,
  18. @JsonKey(name: 'can_manage_topics') bool? canManageTopics,
  19. @JsonKey(name: 'custom_title') String? customTitle,
})

Represents a chat member that has some additional privileges.

The status of this member is always "administrator".

Implementation

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

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

  /// True, if the bot is allowed to edit administrator privileges of that
  /// user
  @JsonKey(name: 'can_be_edited') required bool canBeEdited,

  /// True, if the user's presence in the chat is hidden
  @JsonKey(name: 'is_anonymous') required bool isAnonymous,

  /// True, if the administrator can access the chat event log, get boost
  /// list, see hidden supergroup and channel members, report spam messages
  /// and ignore slow mode
  @JsonKey(name: 'can_manage_chat') required bool canManageChat,

  /// True, if the administrator can delete messages of other users
  @JsonKey(name: 'can_delete_messages') required bool canDeleteMessages,

  /// True, if the administrator can manage video chats
  @JsonKey(name: 'can_manage_video_chats') required bool canManageVideoChats,

  /// True, if the administrator can restrict, ban or unban chat members, or
  /// access supergroup statistics
  @JsonKey(name: 'can_restrict_members') required bool canRestrictMembers,

  /// True, if the administrator can add new administrators with a subset of
  /// their own privileges or demote administrators that they have promoted
  @JsonKey(name: 'can_promote_members') required bool canPromoteMembers,

  /// 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 administrator can post stories to the chat
  @JsonKey(name: 'can_post_stories') required bool canPostStories,

  /// True, if the administrator can edit stories posted by other users
  @JsonKey(name: 'can_edit_stories') required bool canEditStories,

  /// True, if the administrator can delete stories posted by other users
  @JsonKey(name: 'can_delete_stories') required bool canDeleteStories,

  /// Optional. True, if the administrator can post messages in the channel,
  /// or access channel statistics
  @JsonKey(name: 'can_post_messages') bool? canPostMessages,

  /// Optional. True, if the administrator can edit messages of other users
  /// and can pin messages
  @JsonKey(name: 'can_edit_messages') bool? canEditMessages,

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

  /// Optional. True, if the user is allowed to create, rename, close, and
  /// reopen forum topics
  @JsonKey(name: 'can_manage_topics') bool? canManageTopics,

  /// Optional. Custom title for this user
  @JsonKey(name: 'custom_title') String? customTitle,
}) = ChatMemberAdministrator;