Search in sources :

Example 1 with CommandImpl

use of net.dv8tion.jda.internal.interactions.command.CommandImpl in project JDA by DV8FromTheWorld.

the class CommandEditActionImpl method handleSuccess.

@Override
protected void handleSuccess(Response response, Request<Command> request) {
    DataObject json = response.getObject();
    request.onSuccess(new CommandImpl(api, guild, json));
}
Also used : CommandImpl(net.dv8tion.jda.internal.interactions.command.CommandImpl) DataObject(net.dv8tion.jda.api.utils.data.DataObject)

Example 2 with CommandImpl

use of net.dv8tion.jda.internal.interactions.command.CommandImpl in project JDA by DV8FromTheWorld.

the class GuildImpl method retrieveCommandById.

@Nonnull
@Override
public RestAction<Command> retrieveCommandById(@Nonnull String id) {
    Checks.isSnowflake(id);
    Route.CompiledRoute route = Route.Interactions.GET_GUILD_COMMAND.compile(getJDA().getSelfUser().getApplicationId(), getId(), id);
    return new RestActionImpl<>(getJDA(), route, (response, request) -> new CommandImpl(getJDA(), this, response.getObject()));
}
Also used : CommandImpl(net.dv8tion.jda.internal.interactions.command.CommandImpl) Nonnull(javax.annotation.Nonnull)

Example 3 with CommandImpl

use of net.dv8tion.jda.internal.interactions.command.CommandImpl in project JDA by DV8FromTheWorld.

the class JDAImpl method retrieveCommandById.

@Nonnull
@Override
public RestAction<Command> retrieveCommandById(@Nonnull String id) {
    Checks.isSnowflake(id);
    Route.CompiledRoute route = Route.Interactions.GET_COMMAND.compile(getSelfUser().getApplicationId(), id);
    return new RestActionImpl<>(this, route, (response, request) -> new CommandImpl(this, null, response.getObject()));
}
Also used : CommandImpl(net.dv8tion.jda.internal.interactions.command.CommandImpl) Nonnull(javax.annotation.Nonnull)

Example 4 with CommandImpl

use of net.dv8tion.jda.internal.interactions.command.CommandImpl in project JDA by DV8FromTheWorld.

the class CommandCreateActionImpl method handleSuccess.

@Override
protected void handleSuccess(Response response, Request<Command> request) {
    DataObject json = response.getObject();
    request.onSuccess(new CommandImpl(api, guild, json));
}
Also used : CommandImpl(net.dv8tion.jda.internal.interactions.command.CommandImpl) DataObject(net.dv8tion.jda.api.utils.data.DataObject)

Aggregations

CommandImpl (net.dv8tion.jda.internal.interactions.command.CommandImpl)4 Nonnull (javax.annotation.Nonnull)2 DataObject (net.dv8tion.jda.api.utils.data.DataObject)2