mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 20:16:34 +00:00
fixing command alternatives being required
fixing filename for export emote stats fixing reaction report message update
This commit is contained in:
@@ -7,10 +7,9 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface ReactionReportRepository extends JpaRepository<ReactionReport, Long> {
|
||||
|
||||
List<ReactionReport> findByReportedUserAndCreatedLessThan(AUserInAServer aUserInAServer, Instant maxCreated);
|
||||
List<ReactionReport> findByReportedUserAndCreatedGreaterThan(AUserInAServer aUserInAServer, Instant maxCreated);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ReactionReportManagementServiceBean implements ReactionReportManage
|
||||
@Override
|
||||
public Optional<ReactionReport> findRecentReactionReportAboutUser(AUserInAServer aUserInAServer, Duration maxAge) {
|
||||
Instant maxCreation = Instant.now().minus(maxAge);
|
||||
List<ReactionReport> foundReports = repository.findByReportedUserAndCreatedLessThan(aUserInAServer, maxCreation);
|
||||
List<ReactionReport> foundReports = repository.findByReportedUserAndCreatedGreaterThan(aUserInAServer, maxCreation);
|
||||
return foundReports.isEmpty() ? Optional.empty() : Optional.of(foundReports.get(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ public class ExportEmoteStats extends AbstractConditionableCommand {
|
||||
.emotes(usedEmotes)
|
||||
.guild(commandContext.getGuild())
|
||||
.downloadDate(Instant.now())
|
||||
.serverId(commandContext.getGuild().getIdLong())
|
||||
.requester(commandContext.getAuthor())
|
||||
.statsSince(toUseForModel)
|
||||
.build();
|
||||
|
||||
@@ -33,6 +33,7 @@ public class DownloadEmoteStatsModel {
|
||||
* The {@link Member} who requested the export
|
||||
*/
|
||||
private Member requester;
|
||||
private Long serverId;
|
||||
/**
|
||||
* A list of {@link UsedEmote} which are part of the export
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user