ChatPermissions class abstract

Describes actions that a non-administrator user is allowed to take in a chat.

Available extensions
Annotations
  • @freezed

Constructors

ChatPermissions({@JsonKey.new(name: 'can_send_messages') bool? canSendMessages, @JsonKey.new(name: 'can_send_polls') bool? canSendPolls, @JsonKey.new(name: 'can_send_other_messages') bool? canSendOtherMessages, @JsonKey.new(name: 'can_add_web_page_previews') bool? canAddWebPagePreviews, @JsonKey.new(name: 'can_change_info') bool? canChangeInfo, @JsonKey.new(name: 'can_invite_users') bool? canInviteUsers, @JsonKey.new(name: 'can_pin_messages') bool? canPinMessages, @JsonKey.new(name: 'can_manage_topics') bool? canManageTopics, @JsonKey.new(name: 'can_send_audios') bool? canSendAudios, @JsonKey.new(name: 'can_send_documents') bool? canSendDocuments, @JsonKey.new(name: 'can_send_photos') bool? canSendPhotos, @JsonKey.new(name: 'can_send_videos') bool? canSendVideos, @JsonKey.new(name: 'can_send_video_notes') bool? canSendVideoNotes, @JsonKey.new(name: 'can_send_voice_notes') bool? canSendVoiceNotes, @JsonKey.new(name: 'can_edit_tag') bool? canEditTag, @JsonKey.new(name: 'can_react_to_messages') bool? canReactToMessages})
Creates a new ChatPermissions object.
const
factory
ChatPermissions.fromJson(Map<String, dynamic> json)
Creates a new ChatPermissions object from json String.
factory

Properties

canAddWebPagePreviews → bool?
Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
no setterinherited
canChangeInfo → bool?
Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
no setterinherited
canEditTag → bool?
True, if the user is allowed to edit their own tag
no setterinherited
canInviteUsers → bool?
Optional. True, if the user is allowed to invite new users to the chat
no setterinherited
canManageTopics → bool?
Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
no setterinherited
canPinMessages → bool?
Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
no setterinherited
canReactToMessages → bool?
Optional. True, if the user is allowed to react to messages. If omitted, defaults to the value of can_send_messages.
no setterinherited
canSendAudios → bool?
True, if the user is allowed to send audios Since Bot API 6.5
no setterinherited
canSendDocuments → bool?
True, if the user is allowed to send documents
no setterinherited
canSendMessages → bool?
Optional. True, if the user is allowed to send text messages, contacts, locations and venues
no setterinherited
canSendOtherMessages → bool?
Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
no setterinherited
canSendPhotos → bool?
True, if the user is allowed to send photos
no setterinherited
canSendPolls → bool?
Optional. True, if the user is allowed to send polls, implies can_send_messages
no setterinherited
canSendVideoNotes → bool?
True, if the user is allowed to send video notes
no setterinherited
canSendVideos → bool?
True, if the user is allowed to send videos
no setterinherited
canSendVoiceNotes → bool?
True, if the user is allowed to send voice notes
no setterinherited
copyWith → $ChatPermissionsCopyWith<ChatPermissions>
Create a copy of ChatPermissions 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

Methods

map<TResult extends Object?>(TResult $default(_ChatPermissions value)) → TResult

Available on ChatPermissions, provided by the ChatPermissionsPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_ChatPermissions value)?) → TResult?

Available on ChatPermissions, provided by the ChatPermissionsPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_ChatPermissions value)?, {required TResult orElse()}) → TResult

Available on ChatPermissions, provided by the ChatPermissionsPatterns extension

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

Operators

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