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