> For the complete documentation index, see [llms.txt](https://devkiki7000.gitbook.io/discord-components/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devkiki7000.gitbook.io/discord-components/api-reference/interaction.md).

# Interaction

Contains information about components interact event.

{% tabs %}
{% tab title="Attributes" %}

| client                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>The <code>DiscordComponents</code> instance.</p><p></p><p><strong>Type:</strong> <a href="/pages/-MawdcssKHrkRIwSc8-D"><code>discord-components.DiscordComponents</code></a></p> |

| user                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>The user who interacted with the component.</p><p></p><p><strong>Type:</strong>  Optional\[<code>discord.User</code>, <code>discord.Member</code>]</p><p><strong>Alias:</strong> <code>member</code></p> |

| component                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>The component with which the user interacted.<br>This is <code>dict</code> if the component was in a<strong>n</strong> ephemeral message.</p><p></p><p><strong>Type:</strong> <a href="/pages/-MbNkph4GvW_5uhr5S6z"><code>discord-components.Component</code></a></p> |

| custom\_id                                                                                         |
| -------------------------------------------------------------------------------------------------- |
| <p>The custom id of interacted component.</p><p></p><p><strong>Type:</strong> <code>str</code></p> |

| values                                                                                                        |
| ------------------------------------------------------------------------------------------------------------- |
| <p>The values of interacted select</p><p></p><p><strong>Type:</strong> Optional\[List\[<code>str</code>]]</p> |

| `component_type`                                                                                       |
| ------------------------------------------------------------------------------------------------------ |
| <p>The component type of interacted component</p><p></p><p><strong>Type:</strong> <code>int</code></p> |

| raw\_data                                                                           |
| ----------------------------------------------------------------------------------- |
| <p>The request's raw data</p><p></p><p><strong>Type:</strong> <code>dict</code></p> |

| message                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>The mesage with the component interacted.</p><p></p><p><strong>Type:</strong> <a href="/pages/-MawnKUN1hvIyfalW7NX"><code>discord-components.ComponentMessage</code></a></p> |

| guild                                                                                                |
| ---------------------------------------------------------------------------------------------------- |
| <p>The component message’s guild.</p><p></p><p><strong>Type:</strong> <code>discord.Guild</code></p> |

| channel                                                                                                          |
| ---------------------------------------------------------------------------------------------------------------- |
| <p>The component message’s channel.</p><p></p><p><strong>Type:</strong> <code>discord.abc.Messageable</code></p> |

| interaction\_id                                                                   |
| --------------------------------------------------------------------------------- |
| <p>The interaction’s ID.</p><p></p><p><strong>Type:</strong> <code>str</code></p> |

| interaction\_token                                                                   |
| ------------------------------------------------------------------------------------ |
| <p>The interaction’s token.</p><p></p><p><strong>Type:</strong> <code>str</code></p> |

| responded                                                                  |
| -------------------------------------------------------------------------- |
| <p>If responded?</p><p></p><p><strong>Type:</strong> <code>bool</code></p> |

| deferred                                                                  |
| ------------------------------------------------------------------------- |
| <p>If deferred?</p><p></p><p><strong>Type:</strong> <code>bool</code></p> |
| {% endtab %}                                                              |

{% tab title="Methods" %}

| respond                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Sends a response to Discord.<br></p><p><strong>Parameters:</strong></p><ul><li><strong>type</strong> (<code>int</code>) -  The interaction’s type. (4 \~ 6) Defaults to <code>4</code>.</li><li><strong>ephemeral</strong> (<code>bool</code> defaults to <code>True</code>) - If the response is ephemeral.</li><li><strong>content</strong>  (<code>str</code>) - The response message's content.</li><li><strong>embed</strong> (<code>discord.Embed</code>) - The response message’s embed.</li><li><strong>embeds</strong> (List\[<code>discord.Embed</code>]) - The response message’s embeds.</li><li><strong>suppress</strong> (<code>bool</code>) </li><li><strong>file</strong> (<code>discord.File</code>) - The response message’s file.</li><li><strong>files</strong> (List\[<code>discord.File</code>]) - The response message's files.</li><li><strong>allowed\_mentions</strong> ( <code>discord.AllowedMentions</code>) - The response message’s allowed mentions.</li><li><strong>tts</strong> (<code>bool</code> defaults to <code>False</code>) - The response message’s tts.</li><li><strong>components</strong> (List\[<a href="/pages/-MawnKUN1hvIyfalW7NX"><code>discord-components.Component</code></a> | List\[<a href="/pages/-MawnKUN1hvIyfalW7NX"><code>discord-components.Component</code></a>]]) - The components to send.</li></ul><p><strong>Returns:</strong> <a href="/pages/-MawnKUN1hvIyfalW7NX"><code>discord-components.ComponentMessage</code></a></p> |

{% hint style="info" %}
If you don't use the `respond` method after getting a interaction, an interaction error will be thrown.
{% endhint %}
{% endtab %}
{% endtabs %}
