use of sx.blah.discord.api.internal.json.objects.EmojiObject in project Discord4J by Discord4J.
the class EmojiImpl method changeName.
@Override
public void changeName(String name) {
PermissionUtils.requirePermissions(getGuild(), getClient().getOurUser(), Permissions.MANAGE_EMOJIS);
EmojiObject response = ((DiscordClientImpl) getClient()).REQUESTS.PATCH.makeRequest(DiscordEndpoints.GUILDS + getGuild().getStringID() + "/emojis/" + getStringID(), new EmojiEditRequest(name, getRoles().toArray(new IRole[getRoles().size()])), EmojiObject.class);
IEmoji emoji = DiscordUtils.getEmojiFromJSON(getGuild(), response);
}
use of sx.blah.discord.api.internal.json.objects.EmojiObject in project Discord4J by Discord4J.
the class EmojiImpl method changeRoles.
@Override
public void changeRoles(IRole[] roles) {
PermissionUtils.requirePermissions(getGuild(), getClient().getOurUser(), Permissions.MANAGE_EMOJIS);
EmojiObject response = ((DiscordClientImpl) getClient()).REQUESTS.PATCH.makeRequest(DiscordEndpoints.GUILDS + getGuild().getStringID() + "/emojis/" + getStringID(), new EmojiEditRequest(getName(), roles), EmojiObject.class);
IEmoji emoji = DiscordUtils.getEmojiFromJSON(getGuild(), response);
}
Aggregations