Package discord4j.core.object
Class MessageReference
- java.lang.Object
-
- discord4j.core.object.MessageReference
-
- All Implemented Interfaces:
DiscordObject
@Experimental public class MessageReference extends Object implements DiscordObject
A Message Reference used by the Server Following feature.- See Also:
- MessageReference Object
-
-
Constructor Summary
Constructors Constructor Description MessageReference(GatewayDiscordClient gateway, discord4j.discordjson.json.MessageReferenceData data)Constructs aMessageReferencewith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SnowflakegetChannelId()GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.discord4j.discordjson.json.MessageReferenceDatagetData()Gets the data of the message reference.Optional<Snowflake>getGuildId()Optional<Snowflake>getMessageId()StringtoString()
-
-
-
Constructor Detail
-
MessageReference
public MessageReference(GatewayDiscordClient gateway, discord4j.discordjson.json.MessageReferenceData data)
Constructs aMessageReferencewith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated to this object, must be non-null.data- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getData
public discord4j.discordjson.json.MessageReferenceData getData()
Gets the data of the message reference.- Returns:
- The data of the message reference.
-
getChannelId
public Snowflake getChannelId()
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
-