diff --git a/SecondBotEvents/Commands/Inventory.cs b/SecondBotEvents/Commands/Inventory.cs
index 3d782b3..e3831fb 100644
--- a/SecondBotEvents/Commands/Inventory.cs
+++ b/SecondBotEvents/Commands/Inventory.cs
@@ -1060,8 +1060,8 @@ namespace SecondBotEvents.Commands
return Failure("Error");
}
- [About("Requests the contents of a folder as an array of InventoryMapItem
Formated as follows
InventoryMapItem
- id: UUID
- name: String
- typename: String
")]
- [ReturnHints("array of InventoryMapItem")]
+ [About("[Blocking] Requests the contents of a folder as an array of InventoryMapItem
Can block for upto 45 secs!")]
+ [ReturnHints("array of InventoryMapItem Formated as follows
InventoryMapItem
- id: UUID
- name: String
- typename: String
")]
[ReturnHintsFailure("Invaild folder UUID")]
[ArgHints("folderUUID", "the folder to fetch (Found via: inventory/folders)","UUID")]
[CmdTypeGet()]
@@ -1074,6 +1074,27 @@ namespace SecondBotEvents.Commands
return BasicReply(HelperInventory.MapFolderInventoryJson(GetClient(), folder), [folderUUID]);
}
+ [About("Requests the contents of a folder as an array of InventoryMapItem")]
+ [ReturnHints("RequestUUID check the smart reply for results")]
+ [ReturnHints("Smart reply: json object of {request:\"\",status:BOOL,message:\"\",data:\"\"")]
+ [ReturnHintsFailure("Invaild folder UUID")]
+ [ArgHints("folderUUID", "the folder to fetch (Found via: inventory/folders)", "UUID")]
+ [CmdTypeGet()]
+ public object AsyncInventoryContents(string folderUUID, string replyto)
+ {
+ if (UUID.TryParse(folderUUID, out UUID folder) == false)
+ {
+ return Failure("Invaild folder UUID", [folderUUID]);
+ }
+ string request = UUID.Random().Guid.ToString();
+ Task.Run(() => {
+ string results = HelperInventory.MapFolderInventoryJson(GetClient(), folder);
+ string reply = new InventoryAsyncReply(request, true, folderUUID, results).ToJson();
+ master.CommandsService.SmartCommandReply(replyto, reply, "AsyncInventoryContents");
+ });
+ return BasicReply(request, [folderUUID, replyto]);
+ }
+
[About("creates a folder in a folder")]
[ReturnHints("Ok")]
[ReturnHintsFailure("invaild parent folder UUID")]