Skip to content

Commit

Permalink
Fix outdated sticker field name (discord-jda#1732)
Browse files Browse the repository at this point in the history
This fixes Message#getStickers
  • Loading branch information
Andre601 authored and Tais993 committed Sep 13, 2021
1 parent 14276a7 commit bc15b12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/dv8tion/jda/api/entities/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ default List<Button> getButtonsByLabel(@Nonnull String label, boolean ignoreCase

/**
* All {@link net.dv8tion.jda.api.entities.MessageSticker MessageStickers} that are in this Message.
* <br>The returned MessageStickers may only contain necessary information such as the sticker id, format type, name, and icon url.
*
* @throws java.lang.UnsupportedOperationException
* If this is not a Received Message from {@link net.dv8tion.jda.api.entities.MessageType#DEFAULT MessageType.DEFAULT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,10 @@ else if (channel == null)
final int flags = jsonObject.getInt("flags", 0);

MessageChannel tmpChannel = channel; // because java
final List<Message.Attachment> attachments = map(jsonObject, "attachments", this::createMessageAttachment);
final List<MessageEmbed> embeds = map(jsonObject, "embeds", this::createMessageEmbed);
final List<MessageReaction> reactions = map(jsonObject, "reactions", (obj) -> createMessageReaction(tmpChannel, id, obj));
final List<MessageSticker> stickers = map(jsonObject, "stickers", this::createSticker);
final List<Message.Attachment> attachments = map(jsonObject, "attachments", this::createMessageAttachment);
final List<MessageEmbed> embeds = map(jsonObject, "embeds", this::createMessageEmbed);
final List<MessageReaction> reactions = map(jsonObject, "reactions", (obj) -> createMessageReaction(tmpChannel, id, obj));
final List<MessageSticker> stickers = map(jsonObject, "sticker_items", this::createSticker);

MessageActivity activity = null;

Expand Down

0 comments on commit bc15b12

Please sign in to comment.