use of org.javacord.api.interaction.MessageContextMenu in project Javacord by BtoBastian.
the class MessageContextMenuUpdaterDelegateImpl method updateForServer.
@Override
public CompletableFuture<MessageContextMenu> updateForServer(Server server) {
ObjectNode body = JsonNodeFactory.instance.objectNode();
prepareBody(body);
return new RestRequest<MessageContextMenu>(server.getApi(), RestMethod.PATCH, RestEndpoint.SERVER_APPLICATION_COMMANDS).setUrlParameters(String.valueOf(server.getApi().getClientId()), server.getIdAsString(), String.valueOf(commandId)).setBody(body).execute(result -> new MessageContextMenuImpl((DiscordApiImpl) server.getApi(), result.getJsonBody()));
}
use of org.javacord.api.interaction.MessageContextMenu in project Javacord by BtoBastian.
the class MessageContextMenuUpdaterDelegateImpl method updateGlobal.
@Override
public CompletableFuture<MessageContextMenu> updateGlobal(DiscordApi api) {
ObjectNode body = JsonNodeFactory.instance.objectNode();
prepareBody(body);
return new RestRequest<MessageContextMenu>(api, RestMethod.PATCH, RestEndpoint.APPLICATION_COMMANDS).setUrlParameters(String.valueOf(api.getClientId()), String.valueOf(commandId)).setBody(body).execute(result -> new MessageContextMenuImpl((DiscordApiImpl) api, result.getJsonBody()));
}
Aggregations