Skip to content

Commit

Permalink
Documentation updates (#1241)
Browse files Browse the repository at this point in the history
* Add note about presence update and member intents
* Fix typo in readme
* Add MessageChannel#retrieveReactionUsersById and update reaction related docs (#1236)
* Add requirements section to member/user events
  • Loading branch information
MinnDevelopment committed Apr 18, 2020
1 parent c0777ee commit 58cb5c7
Show file tree
Hide file tree
Showing 25 changed files with 471 additions and 151 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -110,7 +110,7 @@ public void configureMemoryUsage(JDABuilder builder) {
builder.setChunkingFilter(ChunkingFilter.NONE);

// Disable presence updates and typing events
builder.disabledIntents(GatewayIntent.GUILD_PRESENCE, GatewayIntent.GUILD_MESSAGE_TYPING);
builder.disableIntents(GatewayIntent.GUILD_PRESENCE, GatewayIntent.GUILD_MESSAGE_TYPING);

// Consider guilds with more than 50 members as "large".
// Large guilds will only provide online members in their setup and thus reduce bandwidth if chunking is disabled.
Expand Down
99 changes: 43 additions & 56 deletions src/main/java/net/dv8tion/jda/api/entities/Message.java
Expand Up @@ -1067,6 +1067,9 @@ default boolean isFromGuild()
* or {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}
* in the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} when adding the reaction.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided emote was deleted, doesn't exist, or is not available to the currently logged-in account in this channel.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand Down Expand Up @@ -1100,7 +1103,7 @@ default boolean isFromGuild()
/**
* Adds a reaction to this Message using a unicode emoji.
* <br>A reference of unicode emojis can be found here:
* <a href="http://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a>.
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a>.
*
* <p>This message instance will not be updated by this operation.
*
Expand Down Expand Up @@ -1136,6 +1139,11 @@ default boolean isFromGuild()
* <br>The reaction request was attempted after the account lost {@link net.dv8tion.jda.api.Permission#MESSAGE_ADD_REACTION Permission.MESSAGE_ADD_REACTION}
* in the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} when adding the reaction.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided unicode character does not refer to a known emoji unicode character.
* <br>Proper unicode characters for emojis can be found here:
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a></li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand Down Expand Up @@ -1223,7 +1231,9 @@ default boolean isFromGuild()
* or losing the {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL VIEW_CHANNEL} permission</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided unicode emoji doesn't exist. Try using one of the example formats.</li>
* <br>The provided unicode character does not refer to a known emoji unicode character.
* <br>Proper unicode characters for emojis can be found here:
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a></li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* <br>The message was deleted.</li>
Expand Down Expand Up @@ -1262,7 +1272,7 @@ default boolean isFromGuild()
* or losing the {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL VIEW_CHANNEL} permission</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided emote was deleted or doesn't exist.</li>
* <br>The provided emote was deleted, doesn't exist, or is not available to the currently logged-in account in this channel.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* <br>The message was deleted.</li>
Expand Down Expand Up @@ -1308,6 +1318,9 @@ default boolean isFromGuild()
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided emote was deleted, doesn't exist, or is not available to the currently logged-in account in this channel.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand Down Expand Up @@ -1360,6 +1373,9 @@ default boolean isFromGuild()
* <br>The reaction request was attempted after the account lost {@link net.dv8tion.jda.api.Permission#MESSAGE_MANAGE Permission.MESSAGE_MANAGE}
* in the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} when removing the reaction.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided emote was deleted, doesn't exist, or is not available to the currently logged-in account in this channel.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand Down Expand Up @@ -1398,7 +1414,7 @@ default boolean isFromGuild()
/**
* Removes a reaction from this Message using a unicode emoji.
* <br>A reference of unicode emojis can be found here:
* <a href="http://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a>.
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a>.
*
* <p>This message instance will not be updated by this operation.
*
Expand All @@ -1424,6 +1440,11 @@ default boolean isFromGuild()
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided unicode character does not refer to a known emoji unicode character.
* <br>Proper unicode characters for emojis can be found here:
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a></li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand All @@ -1450,7 +1471,7 @@ default boolean isFromGuild()
/**
* Removes a reaction from this Message using a unicode emoji.
* <br>A reference of unicode emojis can be found here:
* <a href="http://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a>.
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a>.
*
* <p>Please note that you <b>can't</b> remove reactions of other users if this message was sent in a {@link net.dv8tion.jda.api.entities.PrivateChannel PrivateChannel}!
*
Expand All @@ -1468,6 +1489,11 @@ default boolean isFromGuild()
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided unicode character does not refer to a known emoji unicode character.
* <br>Proper unicode characters for emojis can be found here:
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a></li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
* <br>The reaction request was attempted after the account lost {@link net.dv8tion.jda.api.Permission#MESSAGE_MANAGE Permission.MESSAGE_MANAGE}
* in the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} when removing the reaction.</li>
Expand Down Expand Up @@ -1520,6 +1546,9 @@ default boolean isFromGuild()
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided emote was deleted, doesn't exist, or is not available to the currently logged-in account in this channel.</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand Down Expand Up @@ -1558,6 +1587,11 @@ default boolean isFromGuild()
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
* <br>The provided unicode character does not refer to a known emoji unicode character.
* <br>Proper unicode characters for emojis can be found here:
* <a href="https://unicode.org/emoji/charts/full-emoji-list.html" target="_blank">Emoji Table</a></li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
Expand Down Expand Up @@ -1589,26 +1623,11 @@ default boolean isFromGuild()
* <p>An instance of the related {@link net.dv8tion.jda.api.entities.MessageReaction.ReactionEmote ReactionEmote} can be
* obtained through this method by using the emoji's unicode value.
*
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>The request was attempted after the account lost access to the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel}
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
*
* @param unicode
* The unicode value of the reaction emoji.
*
* @throws java.lang.UnsupportedOperationException
* If this is not a Received Message from {@link net.dv8tion.jda.api.entities.MessageType#DEFAULT MessageType.DEFAULT}
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If the MessageChannel this message was sent in was a {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} and the
* logged in account does not have {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY} in the channel.
* @throws java.lang.IllegalArgumentException
* If the provided unicode value is null or empty.
*
Expand All @@ -1626,28 +1645,13 @@ default boolean isFromGuild()
* <p>Messages store reactions by keeping a list of reaction names.
*
* <p>An instance of the related {@link net.dv8tion.jda.api.entities.MessageReaction.ReactionEmote ReactionEmote} can be
* obtained through this method by using the emoji's id.
*
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>The request was attempted after the account lost access to the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel}
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
* obtained through this method by using the emote's id.
*
* @param id
* The string id of the reaction emoji.
* The string id of the reaction emote.
*
* @throws java.lang.UnsupportedOperationException
* If this is not a Received Message from {@link net.dv8tion.jda.api.entities.MessageType#DEFAULT MessageType.DEFAULT}
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If the MessageChannel this message was sent in was a {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} and the
* logged in account does not have {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY} in the channel.
* @throws java.lang.IllegalArgumentException
* If the provided id is not a valid snowflake.
*
Expand All @@ -1665,30 +1669,13 @@ default boolean isFromGuild()
* <p>Messages store reactions by keeping a list of reaction names.
*
* <p>An instance of the related {@link net.dv8tion.jda.api.entities.MessageReaction.ReactionEmote ReactionEmote} can be
* obtained through this method by using the emoji's id.
*
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>The request was attempted after the account lost access to the {@link net.dv8tion.jda.api.entities.TextChannel TextChannel}
* due to {@link net.dv8tion.jda.api.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked
* <br>Also can happen if the account lost the {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY}</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_MESSAGE UNKNOWN_MESSAGE}
* The reaction request was attempted after the Message had been deleted.</li>
* </ul>
* obtained through this method by using the emote's id.
*
* @param id
* The long id of the reaction emoji.
* The long id of the reaction emote.
*
* @throws java.lang.UnsupportedOperationException
* If this is not a Received Message from {@link net.dv8tion.jda.api.entities.MessageType#DEFAULT MessageType.DEFAULT}
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If the MessageChannel this message was sent in was a {@link net.dv8tion.jda.api.entities.TextChannel TextChannel} and the
* logged in account does not have {@link net.dv8tion.jda.api.Permission#MESSAGE_HISTORY Permission.MESSAGE_HISTORY} in the channel.
* @throws java.lang.IllegalArgumentException
* If the provided id is not a valid snowflake.
*
* @return The {@link net.dv8tion.jda.api.entities.MessageReaction.ReactionEmote ReactionEmote} of this message or null if not present.
*
Expand Down

0 comments on commit 58cb5c7

Please sign in to comment.