🚑 Fix userstats for cache
This commit is contained in:
parent
8dd6c760dc
commit
4bafcb33f4
@ -194,8 +194,8 @@ public class UserStatsUtils {
|
||||
List<UserStats> allStats = userStatsRepository.findByGuildId(guildId);
|
||||
List<GuildStats> ranked = new ArrayList<>();
|
||||
for (UserStats stats : allStats) {
|
||||
if (MainBot.jda.getUserById(stats.getUser().getJdaId()) != null) {
|
||||
String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getEffectiveAvatarUrl();
|
||||
if (CacheTools.getJdaUser(stats.getUser()) != null) {
|
||||
String avatar = CacheTools.getJdaUser(stats.getUser()).getEffectiveAvatarUrl();
|
||||
|
||||
GuildStats temp = new GuildStats(stats.getUser().getName(), 0, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount());
|
||||
if (stats.getUser().getId().equals(userEntity.getId())) {
|
||||
|
@ -168,7 +168,7 @@ public class GeneralWebView {
|
||||
model.addAttribute("stack", stack);
|
||||
try {
|
||||
UserEntity userE = userUtils.getUserWithApiToken(userRepository, token);
|
||||
User user = MainBot.jda.getUserById(userE.getJdaId());
|
||||
User user = CacheTools.getJdaUser(userE);
|
||||
addGuildAndRedirect(model, token, cookieGuildId, user);
|
||||
} catch (UnknownTokenException e) {
|
||||
throw new ForbiddenException();
|
||||
|
Loading…
Reference in New Issue
Block a user