BotCommandScope class sealed

This object represents the scope to which bot commands are applied.

Available extensions
Annotations
  • @Freezed.new(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)

Constructors

BotCommandScope.allChatAdministrators({@Default.new(BotCommandScopeType.allChatAdministrators) @JsonKey.new(name: 'type') BotCommandScopeType type})
Represents the scope of bot commands, covering all group and supergroup chat administrators.
const
factory
BotCommandScope.allGroupChats({@Default.new(BotCommandScopeType.allGroupChats) BotCommandScopeType type})
Represents the scope of bot commands, covering all group and supergroup chats.
const
factory
BotCommandScope.allPrivateChats({@Default.new(BotCommandScopeType.allPrivateChats) @JsonKey.new(name: 'type') BotCommandScopeType type})
Represents the scope of bot commands, covering all private chats.
const
factory
BotCommandScope.chat({@JsonKey.new(name: 'type') @Default.new(BotCommandScopeType.chat) BotCommandScopeType type, @JsonKey.new(name: 'chat_id') @IDConverter() required ID chatId})
Represents the scope of bot commands, covering a specific chat.
const
factory
BotCommandScope.chatAdministrators({@Default.new(BotCommandScopeType.chatAdministrators) @JsonKey.new(name: 'type') BotCommandScopeType type, @JsonKey.new(name: 'chat_id') @IDConverter() required ID chatId})
Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
const
factory
BotCommandScope.chatMember({@JsonKey.new(name: 'type') @Default.new(BotCommandScopeType.chatMember) BotCommandScopeType type, @JsonKey.new(name: 'chat_id') @IDConverter() required ID chatId, @JsonKey.new(name: 'user_id') required int userId})
Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
const
factory
BotCommandScope.default_({@JsonKey.new(name: 'type') @Default.new(BotCommandScopeType.default_) BotCommandScopeType type})
Represents the scope of bot commands, covering all private chats.
const
factory
BotCommandScope.fromJson(Map<String, Object?> json)
factory

Properties

copyWith → $BotCommandScopeCopyWith<BotCommandScope>
Create a copy of BotCommandScope 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
type BotCommandScopeType
Scope type, always be BotCommandScopeType.default_
no setterinherited

Methods

map<TResult extends Object?>({required TResult default_(BotCommandScopeDefault value), required TResult allPrivateChats(BotCommandScopeAllPrivateChats value), required TResult allGroupChats(BotCommandScopeAllGroupChats value), required TResult allChatAdministrators(BotCommandScopeAllChatAdministrators value), required TResult chat(BotCommandScopeChat value), required TResult chatAdministrators(BotCommandScopeChatAdministrators value), required TResult chatMember(BotCommandScopeChatMember value)}) → TResult

Available on BotCommandScope, provided by the BotCommandScopePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? default_(BotCommandScopeDefault value)?, TResult? allPrivateChats(BotCommandScopeAllPrivateChats value)?, TResult? allGroupChats(BotCommandScopeAllGroupChats value)?, TResult? allChatAdministrators(BotCommandScopeAllChatAdministrators value)?, TResult? chat(BotCommandScopeChat value)?, TResult? chatAdministrators(BotCommandScopeChatAdministrators value)?, TResult? chatMember(BotCommandScopeChatMember value)?}) → TResult?

Available on BotCommandScope, provided by the BotCommandScopePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult default_(BotCommandScopeDefault value)?, TResult allPrivateChats(BotCommandScopeAllPrivateChats value)?, TResult allGroupChats(BotCommandScopeAllGroupChats value)?, TResult allChatAdministrators(BotCommandScopeAllChatAdministrators value)?, TResult chat(BotCommandScopeChat value)?, TResult chatAdministrators(BotCommandScopeChatAdministrators value)?, TResult chatMember(BotCommandScopeChatMember value)?, required TResult orElse()}) → TResult

Available on BotCommandScope, provided by the BotCommandScopePatterns 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 BotCommandScope to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

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