Represents an attachment in a dpp::message.
More...
Represents an attachment in a dpp::message.
◆ attachment() [1/2]
dpp::attachment::attachment |
( |
struct message * |
o | ) |
|
Constructs a new attachment object.
- Parameters
-
◆ attachment() [2/2]
dpp::attachment::attachment |
( |
struct message * |
o, |
|
|
nlohmann::json * |
j |
|
) |
| |
Constructs a new attachment object from a JSON object.
- Parameters
-
◆ ~attachment()
dpp::attachment::~attachment |
( |
| ) |
|
|
default |
Destructs the attachment object.
◆ download()
Download this attachment.
- Parameters
-
callback | A callback which is called when the download completes. |
- Note
- The content of the file will be in the http_info.body parameter of the callback parameter.
- Exceptions
-
◆ is_remix()
bool dpp::attachment::is_remix |
( |
| ) |
const |
Returns true if remixed.
- Returns
- true if remixed
◆ content_type
std::string dpp::attachment::content_type |
MIME type of the attachment, if applicable.
◆ description
std::string dpp::attachment::description |
Optional: Description of the attachment. Max 1024 characters.
◆ duration_secs
double dpp::attachment::duration_secs |
The duration of the audio file.
- Note
- Currently for voice messages.
◆ ephemeral
bool dpp::attachment::ephemeral |
Whether this attachment is ephemeral, if applicable.
◆ filename
std::string dpp::attachment::filename |
File name of the attachment.
◆ flags
uint8_t dpp::attachment::flags |
◆ height
uint32_t dpp::attachment::height |
Height of the attachment, if applicable.
◆ id
◆ owner
struct message* dpp::attachment::owner |
◆ proxy_url
std::string dpp::attachment::proxy_url |
Proxied URL which points to the attachment.
◆ size
uint32_t dpp::attachment::size |
Size of the attachment in bytes.
◆ url
std::string dpp::attachment::url |
URL which points to the attachment.
◆ waveform
std::string dpp::attachment::waveform |
Base64 encoded bytearray representing a sampled waveform.
- Note
- Currently for voice messages.
◆ width
uint32_t dpp::attachment::width |
Width of the attachment, if applicable.