Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Sep 13, 2022
2 parents 4390582 + ae72072 commit e85f2de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/de/presti/ree6/events/OtherEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ public void onGuildVoiceLeave(@Nonnull GuildVoiceLeaveEvent event) {
addxp += RandomUtils.random.nextInt(5, 11);
}

VoiceUserLevel oldUserLevel = Main.getInstance().getSqlConnector().getSqlWorker().getVoiceLevelData(event.getGuild().getId(), event.getMember().getId());
VoiceUserLevel newUserLevel = oldUserLevel;
VoiceUserLevel newUserLevel = Main.getInstance().getSqlConnector().getSqlWorker().getVoiceLevelData(event.getGuild().getId(), event.getMember().getId());
VoiceUserLevel oldUserLevel = (VoiceUserLevel) SQLUtil.cloneEntity(VoiceUserLevel.class, newUserLevel);
newUserLevel.setUser(event.getMember().getUser());
newUserLevel.addExperience(addxp);

Expand Down Expand Up @@ -327,15 +327,15 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {

if (!ArrayUtil.timeout.contains(event.getMember())) {

ChatUserLevel olduserLevel = Main.getInstance().getSqlConnector().getSqlWorker().getChatLevelData(event.getGuild().getId(), event.getMember().getId());
ChatUserLevel userLevel = olduserLevel;
ChatUserLevel userLevel = Main.getInstance().getSqlConnector().getSqlWorker().getChatLevelData(event.getGuild().getId(), event.getMember().getId());
ChatUserLevel oldUserLevel = (ChatUserLevel) SQLUtil.cloneEntity(ChatUserLevel.class, userLevel);
userLevel.setUser(event.getMember().getUser());

if (userLevel.addExperience(RandomUtils.random.nextInt(15, 26)) && Main.getInstance().getSqlConnector().getSqlWorker().getSetting(event.getGuild().getId(), "level_message").getBooleanValue()) {
Main.getInstance().getCommandManager().sendMessage("You just leveled up to Chat Level " + userLevel.getLevel() + " " + event.getMember().getAsMention() + " !", event.getChannel());
}

Main.getInstance().getSqlConnector().getSqlWorker().addChatLevelData(event.getGuild().getId(), olduserLevel, userLevel);
Main.getInstance().getSqlConnector().getSqlWorker().addChatLevelData(event.getGuild().getId(), oldUserLevel, userLevel);

ArrayUtil.timeout.add(event.getMember());

Expand Down

0 comments on commit e85f2de

Please sign in to comment.