Repository: Cog-Creators/Red-DiscordBot

Issue:
Allow sending the file in follow-up message in ACL upload commands
### What component of Red (cog, command, API) would you like to see improvements on?

ACL upload commands in Permissions cog

### Describe the enhancement you're suggesting.

The current error message in ACL upload commands ("You must upload a file.") is not very clear about having to run the command file again with the file being attached.

I suggest that rather than improve the error message, we improve the user experience by allowing to send the ACL file in a follow-up message, similarly to how `[p]playlist upload` and `[p]triviaset custom upload` work.

### Anything else?

`[p]set avatar` (and perhaps some other commands?) is another example that doesn't allow sending the file in a follow-up message so it might be worth changing that as well.


Discussion:
I believe trivia custom upload also should be updated to reflect what changes we go with. 
@Stonedestroyer, it already supports both uploading in the command message and follow-up message so it's a good user experience which I don't think we should change. But I guess that also tells me which option we should go for `[p]permissions acl` - we should allow sending the file in a follow-up message and probably do the same for `[p]set avatar` as well?
Oh in thar case I think allowing both may be better UX, though not sure what behavior we should have if user say let's try upload an image, do we ask in followup to upload proper permission file or cancel? But yeah we should probably adopt trivia's way then of asking if not submitted again and if submitted parse it, it will make it more fluid for user. 

I think the main point then is finding all commands thar we can do it at, but if making new core commands maybe some guidelines how approach these commands can be useful in a document or added to Contributing
I'll be looking into implementing this feature with @matcha19. Please let me know if you would like anything else to be considered! :)

Resolving patch:
diff --git a/redbot/cogs/permissions/permissions.py b/redbot/cogs/permissions/permissions.py
--- a/redbot/cogs/permissions/permissions.py
+++ b/redbot/cogs/permissions/permissions.py
@@ -632,11 +632,23 @@ async def _permissions_acl_set(
     ) -> None:
         """Set rules from a YAML file and handle response to users too."""
         if not ctx.message.attachments:
-            await ctx.send(_("You must upload a file."))
-            return
+            await ctx.send(_("Supply a file with next message or type anything to cancel."))
+            try:
+                message = await ctx.bot.wait_for(
+                    "message", check=MessagePredicate.same_context(ctx), timeout=30
+                )
+            except asyncio.TimeoutError:
+                await ctx.send(_("You took too long to upload a file."))
+                return
+            if not message.attachments:
+                await ctx.send(_("You have cancelled the upload process."))
+                return
+            parsedfile = message.attachments[0]
+        else:
+            parsedfile = ctx.message.attachments[0]
 
         try:
-            await self._yaml_set_acl(ctx.message.attachments[0], guild_id=guild_id, update=update)
+            await self._yaml_set_acl(parsedfile, guild_id=guild_id, update=update)
         except yaml.MarkedYAMLError as e:
             await ctx.send(_("Invalid syntax: ") + str(e))
         except SchemaError as e:


Test patch: