Package com.mewna.catnip.entity.message
Interface Message.Attachment
- All Superinterfaces:
Entity
,Snowflake
,Timestamped
- All Known Implementing Classes:
AttachmentImpl
- Enclosing interface:
- Message
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether or not this attachment is ephemeral.fileName()
The name of the file represented by this attachment.int
height()
The height of this attachment, if it's an image.default boolean
image()
Whether this attachment is an image.proxyUrl()
The proxied URL for the file.int
size()
The size of the file represented by this attachment, in bytes.url()
The source URL for the file.int
width()
The width of this attachment, if it's an image.Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
fileName
The name of the file represented by this attachment.- Returns:
- String representing the file name. Never null.
-
size
@Nonnegative @CheckReturnValue int size()The size of the file represented by this attachment, in bytes.- Returns:
- Integer representing the file size. Never negative.
-
url
The source URL for the file.- Returns:
- String representing the source URL. Never null.
-
proxyUrl
The proxied URL for the file.- Returns:
- String representing the proxied URL. Never null.
-
height
@CheckReturnValue int height()The height of this attachment, if it's an image.- Returns:
- Integer representing the height, or -1 if this attachment is not an image.
-
width
@CheckReturnValue int width()The width of this attachment, if it's an image.- Returns:
- Integer representing the width, or -1 if this attachment is not an image.
-
image
@CheckReturnValue default boolean image()Whether this attachment is an image.- Returns:
- True if this attachment is an image, false otherwise.
-
ephemeral
boolean ephemeral()Indicates whether or not this attachment is ephemeral. Ephemeral attachments are automatically removed after a set period of time, the duration of which is unfortunately not documented. Ephemeral attachments are guaranteed to exist for at least as long as their containing message exists.- Returns:
- Whether this attachment is ephemeral.
-