import static method
Import a PaperPlane file.
Implementation
static Future<BotFile> import({
String fileName = 'PaperPlaneBot.json',
}) async {
if (io.FileSystemEntity.typeSync(fileName) ==
io.FileSystemEntityType.notFound) {
throw PaperPlaneException(description: 'BotFile not found.');
}
final content = await io.File(fileName).readAsString();
return BotFile._(
Bot.fromJson(jsonDecode(content)),
fileName: fileName,
);
}