BotCommandScope.fromJson constructor

BotCommandScope.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory BotCommandScope.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case BotCommandScopeDefault.CONSTRUCTOR:
      return BotCommandScopeDefault.fromJson(json);
    case BotCommandScopeAllPrivateChats.CONSTRUCTOR:
      return BotCommandScopeAllPrivateChats.fromJson(json);
    case BotCommandScopeAllGroupChats.CONSTRUCTOR:
      return BotCommandScopeAllGroupChats.fromJson(json);
    case BotCommandScopeAllChatAdministrators.CONSTRUCTOR:
      return BotCommandScopeAllChatAdministrators.fromJson(json);
    case BotCommandScopeChat.CONSTRUCTOR:
      return BotCommandScopeChat.fromJson(json);
    case BotCommandScopeChatAdministrators.CONSTRUCTOR:
      return BotCommandScopeChatAdministrators.fromJson(json);
    case BotCommandScopeChatMember.CONSTRUCTOR:
      return BotCommandScopeChatMember.fromJson(json);
    default:
      return const BotCommandScope();
  }
}