Class MessageReferenceSpec

  • All Implemented Interfaces:
    Spec<discord4j.discordjson.json.MessageReferenceData>

    public class MessageReferenceSpec
    extends Object
    implements Spec<discord4j.discordjson.json.MessageReferenceData>
    Spec used to create a message reference.
    See Also:
    Message Reference
    • Constructor Detail

      • MessageReferenceSpec

        public MessageReferenceSpec()
    • Method Detail

      • setMessageId

        public MessageReferenceSpec setMessageId​(Snowflake messageId)
        Sets the ID of the originating message.
        Parameters:
        messageId - The ID of the originating message.
        Returns:
        This spec.
      • setChannelId

        public MessageReferenceSpec setChannelId​(Snowflake channelId)
        Sets the ID of the originating message's channel.
        Parameters:
        channelId - The ID of the originating message's channel.
        Returns:
        This spec.
      • setGuildId

        public MessageReferenceSpec setGuildId​(Snowflake guildId)
        Sets the ID of the originating message's guild.
        Parameters:
        guildId - The ID of the originating message's guild.
        Returns:
        This spec.
      • setFailIfNotExists

        public MessageReferenceSpec setFailIfNotExists​(boolean failIfNotExists)
        Sets to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true.
        Parameters:
        failIfNotExists - Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message.
        Returns:
        This spec.
      • asRequest

        public discord4j.discordjson.json.MessageReferenceData asRequest()
        Specified by:
        asRequest in interface Spec<discord4j.discordjson.json.MessageReferenceData>