Enum MessageType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MessageType>

    public enum MessageType
    extends java.lang.Enum<MessageType>
    Represents the different types of Messages that can be received from Discord.
    A normal text based message is DEFAULT.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      APPLICATION_COMMAND
      This message was created by an interaction.
      CALL
      Specialized message used for Groups as a System-Message showing that a Call was started.
      CHANNEL_FOLLOW_ADD
      Specialized message used to announce when a crosspost webhook is added to a channel
      CHANNEL_ICON_CHANGE
      Specialized message used for Groups as a System-Message showing that the icon of the Group was changed.
      CHANNEL_NAME_CHANGE
      Specialized message used for Groups as a System-Message showing that the name of the Group was changed.
      CHANNEL_PINNED_ADD
      Specialized message used in MessageChannels as a System-Message to announce new pins
      DEFAULT
      The normal text messages received when a user or bot sends a Message.
      GUILD_BOOST_TIER_1
      Specialized message used to announce the server has reached tier 1
      GUILD_BOOST_TIER_2
      Specialized message used to announce the server has reached tier 2
      GUILD_BOOST_TIER_3
      Specialized message used to announce the server has reached tier 3
      GUILD_DISCOVERY_DISQUALIFIED
      System message related to discovery qualifications.
      GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING
      System message related to discovery qualifications.
      GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING
      System message related to discovery qualifications.
      GUILD_DISCOVERY_REQUALIFIED
      System message related to discovery qualifications.
      GUILD_INVITE_REMINDER
      The "Invite your friends" messages that are sent to guild owners in new servers.
      GUILD_MEMBER_BOOST
      Specialized message used to announce a new booster
      GUILD_MEMBER_JOIN
      Specialized message used to welcome new members in a Guild
      INLINE_REPLY
      Reply to another message.
      RECIPIENT_ADD
      Specialized messages used for Groups as a System-Message showing that a new User has been added to the Group.
      RECIPIENT_REMOVE
      Specialized messages used for Groups as a System-Message showing that a new User has been removed from the Group.
      THREAD_CREATED
      This is sent to a TextChannel when a message thread is created if the message from which the thread was started is "old".
      THREAD_STARTER_MESSAGE
      A new message sent as the first message in threads that are started from an existing message in the parent channel.
      UNKNOWN
      Unknown MessageType.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static MessageType fromId​(int id)
      Used to retrieve a MessageType based on the Discord id key.
      int getId()
      The Discord id key used to reference the MessageType.
      boolean isSystem()
      Whether this message type is for system messages.
      static MessageType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MessageType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DEFAULT

        public static final MessageType DEFAULT
        The normal text messages received when a user or bot sends a Message.
      • RECIPIENT_ADD

        public static final MessageType RECIPIENT_ADD
        Specialized messages used for Groups as a System-Message showing that a new User has been added to the Group. Also used in message threads to indicate a member has joined that thread.
      • RECIPIENT_REMOVE

        public static final MessageType RECIPIENT_REMOVE
        Specialized messages used for Groups as a System-Message showing that a new User has been removed from the Group. Also used in message threads to indicate a member has left that thread.
      • CALL

        public static final MessageType CALL
        Specialized message used for Groups as a System-Message showing that a Call was started.
      • CHANNEL_NAME_CHANGE

        public static final MessageType CHANNEL_NAME_CHANGE
        Specialized message used for Groups as a System-Message showing that the name of the Group was changed. Also used in message threads to indicate the name of that thread has changed.
      • CHANNEL_ICON_CHANGE

        public static final MessageType CHANNEL_ICON_CHANGE
        Specialized message used for Groups as a System-Message showing that the icon of the Group was changed.
      • CHANNEL_PINNED_ADD

        public static final MessageType CHANNEL_PINNED_ADD
        Specialized message used in MessageChannels as a System-Message to announce new pins
      • GUILD_MEMBER_JOIN

        public static final MessageType GUILD_MEMBER_JOIN
        Specialized message used to welcome new members in a Guild
      • GUILD_MEMBER_BOOST

        public static final MessageType GUILD_MEMBER_BOOST
        Specialized message used to announce a new booster
      • GUILD_BOOST_TIER_1

        public static final MessageType GUILD_BOOST_TIER_1
        Specialized message used to announce the server has reached tier 1
      • GUILD_BOOST_TIER_2

        public static final MessageType GUILD_BOOST_TIER_2
        Specialized message used to announce the server has reached tier 2
      • GUILD_BOOST_TIER_3

        public static final MessageType GUILD_BOOST_TIER_3
        Specialized message used to announce the server has reached tier 3
      • CHANNEL_FOLLOW_ADD

        public static final MessageType CHANNEL_FOLLOW_ADD
        Specialized message used to announce when a crosspost webhook is added to a channel
      • GUILD_DISCOVERY_DISQUALIFIED

        public static final MessageType GUILD_DISCOVERY_DISQUALIFIED
        System message related to discovery qualifications.
      • GUILD_DISCOVERY_REQUALIFIED

        public static final MessageType GUILD_DISCOVERY_REQUALIFIED
        System message related to discovery qualifications.
      • GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING

        public static final MessageType GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING
        System message related to discovery qualifications.
      • GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING

        public static final MessageType GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING
        System message related to discovery qualifications.
      • THREAD_CREATED

        public static final MessageType THREAD_CREATED
        This is sent to a TextChannel when a message thread is created if the message from which the thread was started is "old". The definition of "old" is loose, but is currently a very liberal definition.
      • APPLICATION_COMMAND

        public static final MessageType APPLICATION_COMMAND
        This message was created by an interaction. Usually in combination with Slash Commands.
        Most commonly this type will appear as a referenced message.
      • THREAD_STARTER_MESSAGE

        public static final MessageType THREAD_STARTER_MESSAGE
        A new message sent as the first message in threads that are started from an existing message in the parent channel. It only contains a message reference field that points to the message from which the thread was started.
      • GUILD_INVITE_REMINDER

        public static final MessageType GUILD_INVITE_REMINDER
        The "Invite your friends" messages that are sent to guild owners in new servers.
      • UNKNOWN

        public static final MessageType UNKNOWN
        Unknown MessageType.
    • Method Detail

      • values

        public static MessageType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MessageType c : MessageType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MessageType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getId

        public int getId()
        The Discord id key used to reference the MessageType.
        Returns:
        the Discord id key.
      • isSystem

        public boolean isSystem()
        Whether this message type is for system messages.
        These are messages that are sent by discord and don't look like messages from users. Messages like this have some special restrictions.
        Returns:
        True, if this type is for a system message
      • fromId

        @Nonnull
        public static MessageType fromId​(int id)
        Used to retrieve a MessageType based on the Discord id key.
        If the id provided is not a known id, UNKNOWN is returned
        Parameters:
        id - The Discord key id of the requested MessageType.
        Returns:
        A MessageType with the same Discord id key as the one provided, or UNKNOWN.