Package org.javacord.api.entity.intent
Enum Intent
- java.lang.Object
-
- java.lang.Enum<Intent>
-
- org.javacord.api.entity.intent.Intent
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Intent>
public enum Intent extends java.lang.Enum<Intent>
Represents an intent.- See Also:
- Discord docs
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DIRECT_MESSAGE_REACTIONSThe following events are received.DIRECT_MESSAGE_TYPINGThe following events are received.DIRECT_MESSAGESThe following events are received.GUILD_BANSThe following events are received.GUILD_EMOJISThe following events are received.GUILD_INTEGRATIONSThe following events are received.GUILD_INVITESThe following events are received.GUILD_MEMBERSThe following events are received.GUILD_MESSAGE_REACTIONSThe following events are received.GUILD_MESSAGE_TYPINGThe following events are received.GUILD_MESSAGESThe following events are received.GUILD_PRESENCESThe following events are received.GUILD_VOICE_STATESThe following events are received.GUILD_WEBHOOKSThe following events are received.GUILDSThe following event are received.MESSAGE_CONTENTThis is required to receive non-empty values for content fields (content, attachments, embeds and components).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcalculateBitmask(Intent... intents)Gets the bitmask from the given intents.intgetId()Gets the id of the intent.booleanisPrivileged()Check if the intent is privileged.static IntentvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Intent[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GUILDS
public static final Intent GUILDS
The following event are received.- GUILD_CREATE
- GUILD_UPDATE
- GUILD_DELETE
- GUILD_ROLE_CREATE
- GUILD_ROLE_UPDATE
- GUILD_ROLE_DELETE
- CHANNEL_CREATE
- CHANNEL_UPDATE
- CHANNEL_DELETE
- CHANNEL_PINS_UPDATE
-
GUILD_MEMBERS
public static final Intent GUILD_MEMBERS
The following events are received.- GUILD_MEMBER_ADD
- GUILD_MEMBER_UPDATE
- GUILD_MEMBER_REMOVE
Note: This is a privileged intent which must be enabled in the bots application page in the Developer portal
- See Also:
- Discord developer portal
-
GUILD_BANS
public static final Intent GUILD_BANS
The following events are received.- GUILD_BAN_ADD
- GUILD_BAN_REMOVE
-
GUILD_EMOJIS
public static final Intent GUILD_EMOJIS
The following events are received.- GUILD_EMOJIS_UPDATE
-
GUILD_INTEGRATIONS
public static final Intent GUILD_INTEGRATIONS
The following events are received.- GUILD_INTEGRATIONS_UPDATE
-
GUILD_WEBHOOKS
public static final Intent GUILD_WEBHOOKS
The following events are received.- WEBHOOKS_UPDATE
-
GUILD_INVITES
public static final Intent GUILD_INVITES
The following events are received.- INVITE_CREATE
- INVITE_DELETE
-
GUILD_VOICE_STATES
public static final Intent GUILD_VOICE_STATES
The following events are received.- VOICE_STATE_UPDATE
-
GUILD_PRESENCES
public static final Intent GUILD_PRESENCES
The following events are received.- PRESENCE_UPDATE
Note: This is a privileged intent which must be enabled in the bots application page in the Developer portal
- See Also:
- Discord developer portal
-
GUILD_MESSAGES
public static final Intent GUILD_MESSAGES
The following events are received.- MESSAGE_CREATE
- MESSAGE_UPDATE
- MESSAGE_DELETE
- MESSAGE_DELETE_BULK
-
GUILD_MESSAGE_REACTIONS
public static final Intent GUILD_MESSAGE_REACTIONS
The following events are received.- MESSAGE_REACTION_ADD
- MESSAGE_REACTION_REMOVE
- MESSAGE_REACTION_REMOVE_ALL
- MESSAGE_REACTION_REMOVE_EMOJI
-
GUILD_MESSAGE_TYPING
public static final Intent GUILD_MESSAGE_TYPING
The following events are received.- TYPING_START
-
DIRECT_MESSAGES
public static final Intent DIRECT_MESSAGES
The following events are received.- CHANNEL_CREATE
- MESSAGE_CREATE
- MESSAGE_UPDATE
- MESSAGE_DELETE
- CHANNEL_PINS_UPDATE
-
DIRECT_MESSAGE_REACTIONS
public static final Intent DIRECT_MESSAGE_REACTIONS
The following events are received.- MESSAGE_REACTION_ADD
- MESSAGE_REACTION_REMOVE
- MESSAGE_REACTION_REMOVE_ALL
- MESSAGE_REACTION_REMOVE_EMOJI
-
DIRECT_MESSAGE_TYPING
public static final Intent DIRECT_MESSAGE_TYPING
The following events are received.- TYPING_START
-
MESSAGE_CONTENT
public static final Intent MESSAGE_CONTENT
This is required to receive non-empty values for content fields (content, attachments, embeds and components).This doesn't apply for DMs, messages your bot sends, or messages in which your bot is mentioned.
Note: This is a privileged intent which must be enabled in the bots application page in the Developer portal
- See Also:
- Discord developer portal
-
-
Method Detail
-
values
public static Intent[] 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 (Intent c : Intent.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Intent 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 namejava.lang.NullPointerException- if the argument is null
-
getId
public int getId()
Gets the id of the intent.- Returns:
- The id of the intent.
-
isPrivileged
public boolean isPrivileged()
Check if the intent is privileged.Privileged intents are usually related so sensitive data and must manually be enabled in the developer portal.
- Returns:
- Whether this intent is privileged or not.
-
calculateBitmask
public static int calculateBitmask(Intent... intents)
Gets the bitmask from the given intents.- Parameters:
intents- An array of intents.- Returns:
- The calculated bitmask.
-
-