Skip to content

Commit

Permalink
fix formatting and optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaktushose committed Aug 7, 2024
1 parent 2a7a4d5 commit e71f99c
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<dependency>
<groupId>com.github.Kaktushose</groupId>
<artifactId>jda-commands</artifactId>
<version>04ff5c267d</version>
<version>d1e7cb6229</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {
return;
}
event.getChannel().sendMessage(embedCache.getEmbed("legacyCommandInfo").toMessageCreateData()).queue(it ->
it.delete().queueAfter(30, TimeUnit.SECONDS)
it.delete().queueAfter(30, TimeUnit.SECONDS)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import com.github.kaktushose.nplaybot.items.ItemService;
import com.github.kaktushose.nplaybot.rank.RankService;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.events.guild.member.*;
import net.dv8tion.jda.api.events.user.GenericUserEvent;
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
import net.dv8tion.jda.api.events.guild.member.GuildMemberUpdateEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

public class ItemService {

private static final int PLAY_ACTIVITY_ITEM_ID = 7;
public static final int PREMIUM_BASE_TYPE_ID = 2;
public static final int PREMIUM_UNLIMITED_ITEM_ID = 9;
private static final int PLAY_ACTIVITY_ITEM_ID = 7;
private final DataSource dataSource;
private final Guild guild;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import com.github.kaktushose.nplaybot.items.ItemService;
import com.github.kaktushose.nplaybot.rank.RankService;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.UserSnowflake;
import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.entities.emoji.UnicodeEmoji;
import net.dv8tion.jda.api.utils.data.DataObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

import com.github.kaktushose.nplaybot.Bot;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.UserSnowflake;
import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
import net.dv8tion.jda.api.utils.messages.MessageCreateData;
import org.jetbrains.annotations.NotNull;

import java.util.concurrent.Executors;
Expand Down Expand Up @@ -75,7 +73,7 @@ public void onMessageReactionAdd(@NotNull MessageReactionAddEvent event) {
bot.getDatabase().getRankService().onXpChange(result, event.getMember(), bot.getEmbedCache());
var message = new MessageCreateBuilder()
.addContent(target.getAsMention())
.addEmbeds(bot.getEmbedCache().getEmbed("onLootboxXp").injectValue("xp", lootbox.xpReward()).toMessageEmbed());
.addEmbeds(bot.getEmbedCache().getEmbed("onLootboxXp").injectValue("xp", lootbox.xpReward()).toMessageEmbed());

event.getChannel().sendMessage(message.build()).queue(it -> it.delete().queueAfter(1, TimeUnit.MINUTES));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
public class RankListener extends ListenerAdapter {

private static final Logger log = LoggerFactory.getLogger(RankListener.class);
private static final String XP_LOOT_DROP_EMOJI = "\uD83D\uDFE2";
private final RankService rankService;
private final PermissionsService permissionsService;
private final EmbedCache embedCache;
private final Bot bot;
private final Map<Long, Integer> xpLootDrops;
private static final String XP_LOOT_DROP_EMOJI = "\uD83D\uDFE2";

public RankListener(Database database, EmbedCache embedCache, Bot bot) {
this.rankService = database.getRankService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import java.util.Map;
import java.util.Optional;

public record UserInfo(long id, int currentXp, RankInfo currentRank, Optional<RankInfo> nextRank, int messageCount, int xpGain,
public record UserInfo(long id, int currentXp, RankInfo currentRank, Optional<RankInfo> nextRank, int messageCount,
int xpGain,
int karma, int lastKarma, long lastValidMessage) {

@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Calendar;
import java.util.concurrent.Executors;
Expand Down

0 comments on commit e71f99c

Please sign in to comment.