Skip to content

Commit

Permalink
Add MessageChannel#retrieveReactionUsersById and update reaction rela…
Browse files Browse the repository at this point in the history
…ted docs (#1236)
  • Loading branch information
gpluscb committed Apr 7, 2020
1 parent 9a8dda3 commit 8dde11c
Show file tree
Hide file tree
Showing 7 changed files with 336 additions and 127 deletions.
103 changes: 47 additions & 56 deletions src/main/java/net/dv8tion/jda/api/entities/Message.java
Original file line number Diff line number Diff line change
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 @@ -1219,7 +1227,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 @@ -1253,7 +1263,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 @@ -1296,6 +1306,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 @@ -1346,6 +1359,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 All @@ -1367,6 +1383,8 @@ default boolean isFromGuild()
* <li>If the provided {@link net.dv8tion.jda.api.entities.Emote Emote} cannot be used in the current channel.
* See {@link Emote#canInteract(User, MessageChannel)} or {@link Emote#canInteract(Member)} for more information.</li>
* </ul>
* @throws java.lang.IllegalStateException
* If the message was not sent in a TextChannel.
*
* @return {@link net.dv8tion.jda.api.requests.RestAction RestAction} - Type: {@link java.lang.Void}
*
Expand All @@ -1379,7 +1397,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 @@ -1405,6 +1423,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 @@ -1431,7 +1454,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 @@ -1447,6 +1470,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 All @@ -1471,6 +1499,8 @@ default boolean isFromGuild()
* </ul>
* @throws java.lang.IllegalArgumentException
* If the provided unicode emoji is null or empty.
* @throws java.lang.IllegalStateException
* If the message was not sent in a TextChannel.
*
* @return {@link net.dv8tion.jda.api.requests.RestAction RestAction} - Type: {@link java.lang.Void}
*
Expand All @@ -1495,6 +1525,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 @@ -1533,6 +1566,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 @@ -1564,26 +1602,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 @@ -1601,28 +1624,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 @@ -1640,30 +1648,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 8dde11c

Please sign in to comment.