BotCommandScopePatterns extension
Adds pattern-matching-related methods to BotCommandScope.
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
Aswitch-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 ofmapthat fallback to returningnull. -
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 ofmapthat fallback to returningorElse.