Skip to content

Commit

Permalink
Add content for updateApplicationEmojiName
Browse files Browse the repository at this point in the history
+ remove TODOs
  • Loading branch information
Andre601 committed Aug 5, 2024
1 parent 5105d1b commit 8d0f45c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/net/dv8tion/jda/internal/JDAImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,6 @@ public RestAction<List<ApplicationEmoji>> retrieveApplicationEmojis()
List<ApplicationEmoji> list = new ArrayList<>(emojis.length());
for (int i = 0; i < emojis.length(); i++)
{
// TODO: Find a way to make custom emoji without needing Guild instance.
list.add(entityBuilder.createApplicationEmoji(this, emojis.getObject(i)));
}

Expand All @@ -721,7 +720,6 @@ public RestAction<ApplicationEmoji> retrieveApplicationEmojiById(long emojiId)
{
Route.CompiledRoute route = Route.Applications.GET_APPLICATION_EMOJI.compile(getSelfUser().getApplicationId(), String.valueOf(emojiId));
return new RestActionImpl<>(this, route,
// TODO: Find a way to make custom emoji without needing Guild instance.
(response, request) -> entityBuilder.createApplicationEmoji(this, response.getObject())
);
}
Expand All @@ -730,7 +728,14 @@ public RestAction<ApplicationEmoji> retrieveApplicationEmojiById(long emojiId)
@Override
public RestAction<ApplicationEmoji> updateApplicationEmojiName(long emojiId, @NotNull String name)
{
return null;
Checks.inRange(name, 2, 32, "Emoji name");

Route.CompiledRoute route = Route.Applications.MODIFY_APPLICATION_EMOJI.compile(getSelfUser().getApplicationId(), String.valueOf(emojiId));
DataObject body = DataObject.empty();
body.put("name", name);
return new RestActionImpl<>(this, route, body,
(response, request) -> entityBuilder.createApplicationEmoji(this, response.getObject())
);
}

@Override
Expand Down

0 comments on commit 8d0f45c

Please sign in to comment.