Default avatar round 2 !

This commit is contained in:
Sebastien 2019-01-01 23:12:10 +01:00
parent ddd9d070e4
commit 49f796fe34
2 changed files with 2 additions and 5 deletions

View File

@ -22,10 +22,7 @@ public class GuildStats{
public GuildStats(String userName, int rank, String avatarUrl, long voiceTime, long messageCount, long apiCount) { public GuildStats(String userName, int rank, String avatarUrl, long voiceTime, long messageCount, long apiCount) {
this.userName = userName; this.userName = userName;
if(avatarUrl != null)
this.avatarUrl = avatarUrl; this.avatarUrl = avatarUrl;
else
this.avatarUrl = "https://discordapp.com/assets/dd4dbc0016779df1378e7812eabaa04d.png";
this.voiceTime = voiceTime; this.voiceTime = voiceTime;
this.messageCount = messageCount; this.messageCount = messageCount;
this.apiCount = apiCount; this.apiCount = apiCount;

View File

@ -166,7 +166,7 @@ public class UserStatsUtils {
List<UserStats> allStats = userStatsRepository.findByGuildId(guildId); List<UserStats> allStats = userStatsRepository.findByGuildId(guildId);
List<GuildStats> ranked = new ArrayList<>(); List<GuildStats> ranked = new ArrayList<>();
for(UserStats stats : allStats){ for(UserStats stats : allStats){
String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getAvatarUrl(); String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getEffectiveAvatarUrl();
GuildStats temp = new GuildStats(stats.getUser().getName(), 0, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount()); GuildStats temp = new GuildStats(stats.getUser().getName(), 0, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount());
if(stats.getUser().getId().equals(userEntity.getId())){ if(stats.getUser().getId().equals(userEntity.getId())){
selfGuildStats = temp; selfGuildStats = temp;