> For the complete documentation index, see [llms.txt](https://dbd-ts.gitbook.io/dbdts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dbd-ts.gitbook.io/dbdts/functions/attachment.md).

# $attachment

Adds a attachment to the bot's response.

### Usage

```php
$attachment[URL;name.extension]
```

This function has two params.

| Param          | Description                                | Type   | Required |
| -------------- | ------------------------------------------ | ------ | -------- |
| URL            | The URL of this attachment.                | String | Yes      |
| name.extension | The name and extension of this attachment. | String | No       |

{% hint style="danger" %}
The 'URL' must end with a extension, else it is sent as a unpreviewable file.
{% endhint %}

### Example

```javascript
bot.commands.add({
    type: "basicCommand",
    name: "attachment",
    code: `$attachment[https://imgur.com/eZfedQF.png;image.png]`
})
```

![Result](https://user-images.githubusercontent.com/69215413/132230947-4ef1d689-da5d-4f74-90ba-5a9a03ed980d.png)
