use of io.discloader.discloader.entity.auditlog.IAuditLog in project DiscLoader by R3alCl0ud.
the class Guild method getAuditLog.
/*
* (non-Javadoc)
*
* @see io.discloader.discloader.entity.guild.IGuild#getAuditLog(io.discloader.
* discloader.entity.auditlog.ActionTypes, short)
*/
@Override
public CompletableFuture<IAuditLog> getAuditLog(ActionTypes action, int limit) {
CompletableFuture<IAuditLog> future = new CompletableFuture<>();
CompletableFuture<AuditLogJSON> cf = loader.rest.request(Methods.GET, Endpoints.auditLogs(getID()) + "?action_type=" + action.toInt() + "&limit=" + limit, new RESTOptions(), AuditLogJSON.class);
cf.thenAcceptAsync(al -> {
future.complete(new AuditLog(this, al));
});
cf.exceptionally(ex -> {
future.completeExceptionally(ex);
return null;
});
return future;
}
use of io.discloader.discloader.entity.auditlog.IAuditLog in project DiscLoader by R3alCl0ud.
the class Guild method getAuditLog.
@Override
public CompletableFuture<IAuditLog> getAuditLog(IUser user, ActionTypes action, IAuditLogEntry before, int limit) {
CompletableFuture<IAuditLog> future = new CompletableFuture<>();
JSONObject params = new JSONObject().put("user_id", SnowflakeUtil.asString(user)).put("action_type", action.toInt()).put("before", SnowflakeUtil.asString(before)).put("limit", limit);
CompletableFuture<AuditLogJSON> cf = loader.rest.request(Methods.GET, Endpoints.auditLogs(getID()), new RESTOptions(params), AuditLogJSON.class);
cf.thenAcceptAsync(al -> {
future.complete(new AuditLog(this, al));
});
cf.exceptionally(ex -> {
future.completeExceptionally(ex);
return null;
});
return future;
}
use of io.discloader.discloader.entity.auditlog.IAuditLog in project DiscLoader by R3alCl0ud.
the class Guild method getAuditLog.
@Override
public CompletableFuture<IAuditLog> getAuditLog(IUser user, int limit) {
CompletableFuture<IAuditLog> future = new CompletableFuture<>();
JSONObject params = new JSONObject().put("user_id", SnowflakeUtil.asString(user)).put("limit", limit);
CompletableFuture<AuditLogJSON> cf = loader.rest.request(Methods.GET, Endpoints.auditLogs(getID()), new RESTOptions(params), AuditLogJSON.class);
cf.thenAcceptAsync(al -> {
future.complete(new AuditLog(this, al));
});
cf.exceptionally(ex -> {
future.completeExceptionally(ex);
return null;
});
return future;
}
Aggregations