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
A coro (coroutine) is a method that needs to be awaited means ``await method``.
210
+
A `coroutine <https://docs.python.org/3/library/asyncio-task.html#coroutine>`_ is a function that must be invoked with ``await`` or ``yield from``.
211
+
When Python encounters an ``await`` it stops the function’s execution at that point and works on other things until it comes back to that point and finishes off its work.
212
+
This allows for your program to be doing multiple things at the same time without using threads or complicated multiprocessing.
213
+
214
+
**If you forget to await a coroutine then the coroutine will not run. Never forget to await a coroutine.**
211
215
212
-
See the official `Python-Docs <https://docs.python.org/3/c-api/coro.html>`_.
Copy file name to clipboardExpand all lines: docs/interaction.rst
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,11 +60,11 @@ Interaction
60
60
.. attribute:: message
61
61
62
62
The message the component was attached to.
63
-
This will be equal to ``None`` if the :attr:`component_type` is ``None`` or the message the component is attached to is ``ephemeral``.
63
+
This will be :class:`EphemeralMessage` if the :attr:`component_type` is not ``None`` or the message the component is attached to is ``ephemeral``.
64
64
65
65
.. note::
66
66
In this version, this parameter should always be an object of type :class:`discord.Message`
67
-
(or ``None`` if the message is ephemeral) because it only gets initiated when the interaction_type is higher than 2.
67
+
(or :class:`EphemeralMessage` if the message is ephemeral) because it only gets initiated when the interaction_type is higher than 2.
68
68
69
69
.. attribute:: channel
70
70
@@ -85,18 +85,25 @@ Interaction
85
85
.. note::
86
86
If this is passed in an ``[on_][raw_]button_click`` or ``[on_][raw_]selection_select`` Event there would be a second parameter that includes this attribute.
The type to response with, aiter :class:`InteractionCallbackType.deferred_msg_with_source` or :class:`InteractionCallbackType.deferred_update_msg` (e.g. 5 or 6)
98
105
99
-
:param hidden: Optional[bool] = False
106
+
:param hidden: Optional[bool]
100
107
Whether to defer ephemerally(only the :attr:`author` of the interaction can see the message)
101
108
102
109
.. note::
@@ -110,8 +117,8 @@ Interaction
110
117
111
118
.. note::
112
119
A Token will be Valid for 15 Minutes so you could edit the original :attr:`message` with :meth:`edit`, :meth:`respond` or doing anything other with this interaction for 15 minutes.
113
-
after that time you have to edit the original message with the Methode :meth:`edit` of the :attr:`message` and sending new messages with the :meth:`send` Methode of :attr:`channel`
114
-
(you could not do this hidden as it isn't an respond anymore)
120
+
after that time you have to edit the original message with the Methode ``edit`` of the :attr:`message` and sending new messages with the ``send`` Methode of :attr:`channel`
121
+
(you could not do this hidden as it isn't an interaction-response anymore)
115
122
116
123
.. method:: edit(**fields)
117
124
@@ -120,7 +127,7 @@ Interaction
120
127
Edit the :class:`Message` the component is attached to, if the interaction is not deferred it will defer automatic.
121
128
122
129
.. note::
123
-
If you have not yet defered or defered with type :class:`InteractionCallbackType.deferred_update_msg`, edit the message to which the component is attached, otherwise edit the callback message.
130
+
If you have not yet deferred or deferred with type :class:`InteractionCallbackType.deferred_update_msg`, edit the message to which the component is attached, otherwise edit the callback message.
124
131
125
132
:param \**fields: The fields of the original message to replace. You could pass the same Parameters as using :meth:`discord.Message.edit`
126
133
@@ -139,7 +146,7 @@ Interaction
139
146
If you send an ``hidden`` (ephemeral)-respond, discord don't returns any data like an message you could edit,
140
147
**but** you could receive Interactions when the Author interact with an component in the message.
0 commit comments