ChatMember class sealed

This object contains information about one member of a chat.

Currently, the following 6 types of chat members are supported:

  • ChatMemberOwner
  • ChatMemberAdministrator
  • ChatMemberMember
  • ChatMemberRestricted
  • ChatMemberLeft
  • ChatMemberBanned
Annotations
  • @Freezed.new(unionKey: 'status', unionValueCase: FreezedUnionCase.snake)

Constructors

ChatMember.administrator({@Default.new(ChatMemberStatus.administrator) @JsonKey.new(name: 'status') ChatMemberStatus status, @JsonKey.new(name: 'user') required User user, @JsonKey.new(name: 'can_be_edited') required bool canBeEdited, @JsonKey.new(name: 'is_anonymous') required bool isAnonymous, @JsonKey.new(name: 'can_manage_chat') required bool canManageChat, @JsonKey.new(name: 'can_delete_messages') required bool canDeleteMessages, @JsonKey.new(name: 'can_manage_video_chats') required bool canManageVideoChats, @JsonKey.new(name: 'can_restrict_members') required bool canRestrictMembers, @JsonKey.new(name: 'can_promote_members') required bool canPromoteMembers, @JsonKey.new(name: 'can_change_info') required bool canChangeInfo, @JsonKey.new(name: 'can_invite_users') required bool canInviteUsers, @JsonKey.new(name: 'can_post_stories') required bool canPostStories, @JsonKey.new(name: 'can_edit_stories') required bool canEditStories, @JsonKey.new(name: 'can_delete_stories') required bool canDeleteStories, @JsonKey.new(name: 'can_post_messages') bool? canPostMessages, @JsonKey.new(name: 'can_edit_messages') bool? canEditMessages, @JsonKey.new(name: 'can_pin_messages') bool? canPinMessages, @JsonKey.new(name: 'can_manage_topics') bool? canManageTopics, @JsonKey.new(name: 'custom_title') String? customTitle})
Represents a chat member that has some additional privileges.
const
factory
ChatMember.creator({@Default.new(ChatMemberStatus.creator) @JsonKey.new(name: 'status') ChatMemberStatus status, @JsonKey.new(name: 'user') required User user, @JsonKey.new(name: 'is_anonymous') required bool isAnonymous, @JsonKey.new(name: 'custom_title') String? customTitle})
Represents a chat member that owns the chat and has all administrator privileges.
const
factory
ChatMember.fromJson(Map<String, dynamic> json)
Creates the ChatMember instance from the JSON map
factory
ChatMember.kicked({@Default.new(ChatMemberStatus.kicked) @JsonKey.new(name: 'status') ChatMemberStatus status, @JsonKey.new(name: 'user') required User user, @JsonKey.new(name: 'until_date') required int untilDate})
Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
const
factory
ChatMember.left({@JsonKey.new(name: 'status') @Default.new(ChatMemberStatus.left) ChatMemberStatus status, @JsonKey.new(name: 'user') required User user})
Represents a chat member that isn't currently a member of the chat, but may join it themselves.
const
factory
ChatMember.member({@Default.new(ChatMemberStatus.member) @JsonKey.new(name: 'status') ChatMemberStatus status, @JsonKey.new(name: 'user') required User user, @JsonKey.new(name: 'until_date') int? untilDate})
Represents a chat member that has no additional privileges or restrictions.
const
factory
ChatMember.restricted({@Default.new(ChatMemberStatus.restricted) @JsonKey.new(name: 'status') ChatMemberStatus status, @JsonKey.new(name: 'user') required User user, @JsonKey.new(name: 'is_member') required bool isMember, @JsonKey.new(name: 'can_send_messages') required bool canSendMessages, @JsonKey.new(name: 'can_send_audios') required bool canSendAudios, @JsonKey.new(name: 'can_send_documents') required bool canSendDocuments, @JsonKey.new(name: 'can_send_photos') required bool canSendPhotos, @JsonKey.new(name: 'can_send_videos') required bool canSendVideos, @JsonKey.new(name: 'can_send_video_notes') required bool canSendVideoNotes, @JsonKey.new(name: 'can_send_voice_notes') required bool canSendVoiceNotes, @JsonKey.new(name: 'can_send_polls') required bool canSendPolls, @JsonKey.new(name: 'can_send_other_messages') required bool canSendOtherMessages, @JsonKey.new(name: 'can_add_web_page_previews') required bool canAddWebPagePreviews, @JsonKey.new(name: 'can_change_info') required bool canChangeInfo, @JsonKey.new(name: 'can_invite_users') required bool canInviteUsers, @JsonKey.new(name: 'can_pin_messages') required bool canPinMessages, @JsonKey.new(name: 'can_manage_topics') required bool canManageTopics, @JsonKey.new(name: 'until_date') required int untilDate})
Represents a chat member that is under certain restrictions in the chat. Supergroups only.
const
factory

Properties

copyWith → $ChatMemberCopyWith<ChatMember>
Create a copy of ChatMember with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → ChatMemberStatus
The member's status in the chat
no setterinherited
user → User
Information about the user
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this ChatMember to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited