Class MediaGalleryItemImpl
java.lang.Object
net.dv8tion.jda.internal.components.mediagallery.MediaGalleryItemImpl
- All Implemented Interfaces:
MediaGalleryItem
,SerializableData
,FileContainerMixin
Represents either an external link, an attachment:// link, or an existing item (which is also a link)
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.components.mediagallery.MediaGalleryItem
MAX_DESCRIPTION_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionMediaGalleryItemImpl
(String url, String description, ResolvedMedia media, boolean spoiler) -
Method Summary
Modifier and TypeMethodDescriptionboolean
The description of this item, ornull
if none has been set.getFiles()
The media resolved from this item, this is only available if you receive this component from Discord.getUrl()
The URL of this item, this is always where the file originally came from.int
hashCode()
boolean
Whether this item is hidden until the user clicks on it.toData()
SerializedDataObject
for this object.toString()
withDescription
(String description) Creates a newMediaGalleryItem
with the provided description.withSpoiler
(boolean spoiler) Creates a newMediaGalleryItem
with the provided spoiler status.
-
Constructor Details
-
MediaGalleryItemImpl
-
MediaGalleryItemImpl
-
MediaGalleryItemImpl
-
-
Method Details
-
withDescription
Description copied from interface:MediaGalleryItem
Creates a newMediaGalleryItem
with the provided description.
The description is known as an "alternative text", and must not exceed 1024 characters.- Specified by:
withDescription
in interfaceMediaGalleryItem
- Parameters:
description
- The new description- Returns:
- The new
MediaGalleryItem
-
withSpoiler
Description copied from interface:MediaGalleryItem
Creates a newMediaGalleryItem
with the provided spoiler status.
Spoilers are hidden until the user clicks on it.- Specified by:
withSpoiler
in interfaceMediaGalleryItem
- Parameters:
spoiler
- The new spoiler status- Returns:
- The new
MediaGalleryItem
-
getUrl
Description copied from interface:MediaGalleryItem
The URL of this item, this is always where the file originally came from.
This can be eitherattachment://filename.extension
or an actual URL.If you want to download the file, you should use
MediaGalleryItem.getResolvedMedia()
thenResolvedMedia.getProxy()
, to avoid connecting your bot to unknown servers.- Specified by:
getUrl
in interfaceMediaGalleryItem
- Returns:
- The URL of this item
-
getResolvedMedia
Description copied from interface:MediaGalleryItem
The media resolved from this item, this is only available if you receive this component from Discord.- Specified by:
getResolvedMedia
in interfaceMediaGalleryItem
- Returns:
- Possibly-null
ResolvedMedia
-
getFiles
- Specified by:
getFiles
in interfaceFileContainerMixin
-
getDescription
Description copied from interface:MediaGalleryItem
The description of this item, ornull
if none has been set.- Specified by:
getDescription
in interfaceMediaGalleryItem
- Returns:
- Possibly-null description
-
isSpoiler
public boolean isSpoiler()Description copied from interface:MediaGalleryItem
Whether this item is hidden until the user clicks on it.- Specified by:
isSpoiler
in interfaceMediaGalleryItem
- Returns:
true
if this is hidden by default,false
otherwise
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
equals
-
hashCode
public int hashCode() -
toString
-