$messageAttachment

This function retrieves the URL of the first attachment found in a message. If a message has multiple attachments, only the URL of the first one will be returned.

Usage:

$messageAttachment

Example:

This example demonstrates how $messageAttachment can be used.

Member04/23/2025
!!exec $messageAttachment
Custom Command Bot 04/23/2025
https://media.discordapp.net/avatars/725721249652670555/781224f90c3b841ba5b40678e032f74a.webp

Explanation:

  • The member sends the command !!exec $messageAttachment.
  • The bot returns the URL of the first attachment in the member's message. If the message does not contain any attachment it will return an empty string.
Function Difficulty: Easy
Tags: Attachment Message