You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 28, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: docs/ext/commands/commands.rst
+79
Original file line number
Diff line number
Diff line change
@@ -639,6 +639,85 @@ This command can be invoked any of the following ways:
639
639
To help aid with some parsing ambiguities, :class:`str`, ``None``, :data:`typing.Optional` and
640
640
:class:`~ext.commands.Greedy` are forbidden as parameters for the :class:`~ext.commands.Greedy` converter.
641
641
642
+
643
+
discord.Attachment
644
+
^^^^^^^^^^^^^^^^^^^
645
+
646
+
.. versionadded:: 2.0
647
+
648
+
The :class:`discord.Attachment` converter is a special converter that retrieves an attachment from the uploaded attachments on a message. This converter *does not* look at the message content at all and just the uploaded attachments.
await ctx.send(f'You have uploaded <{attachment.url}>')
659
+
660
+
661
+
When this command is invoked, the user must directly upload a file for the command body to be executed. When combined with the :data:`typing.Optional` converter, the user does not have to provide an attachment.
Note that using a :class:`discord.Attachment` converter after a :class:`~ext.commands.Greedy` of :class:`discord.Attachment` will always fail since the greedy had already consumed the remaining attachments.
718
+
719
+
If an attachment is expected but not given, then :exc:`~ext.commands.MissingRequiredAttachment` is raised to the error handlers.
0 commit comments