Skip to content

Commit f86b812

Browse files
optimized imports
1 parent 7e5ab0a commit f86b812

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

src/main/java/net/javadiscord/javabot/data/h2db/commands/DbAdminCommandHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import net.dv8tion.jda.api.interactions.commands.Command;
55
import net.dv8tion.jda.api.requests.restaction.interactions.AutoCompleteCallbackAction;
66
import net.javadiscord.javabot.command.DelegatingCommandHandler;
7-
import net.javadiscord.javabot.data.h2db.commands.message_cache.MessageCacheInfoSubcommand;
8-
import java.util.Map;
97
import net.javadiscord.javabot.command.interfaces.Autocompletable;
8+
import net.javadiscord.javabot.data.h2db.commands.message_cache.MessageCacheInfoSubcommand;
109
import net.javadiscord.javabot.util.AutocompleteUtils;
10+
1111
import java.util.List;
12+
import java.util.Map;
1213

1314
/**
1415
* Handler class for all Database related commands.

src/main/java/net/javadiscord/javabot/data/h2db/message_cache/MessageCache.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import lombok.extern.slf4j.Slf4j;
44
import net.dv8tion.jda.api.EmbedBuilder;
55
import net.dv8tion.jda.api.entities.*;
6-
import net.dv8tion.jda.api.events.message.MessageDeleteEvent;
7-
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
8-
import net.dv8tion.jda.api.events.message.MessageUpdateEvent;
9-
import net.dv8tion.jda.api.hooks.ListenerAdapter;
106
import net.dv8tion.jda.api.interactions.components.buttons.Button;
117
import net.dv8tion.jda.api.requests.restaction.MessageAction;
128
import net.javadiscord.javabot.Bot;
@@ -17,7 +13,6 @@
1713
import net.javadiscord.javabot.systems.commands.IdCalculatorCommand;
1814
import net.javadiscord.javabot.util.GuildUtils;
1915
import net.javadiscord.javabot.util.TimeUtils;
20-
import org.jetbrains.annotations.NotNull;
2116

2217
import java.io.ByteArrayInputStream;
2318
import java.io.InputStream;
@@ -29,7 +24,6 @@
2924
import java.time.format.DateTimeFormatter;
3025
import java.util.ArrayList;
3126
import java.util.List;
32-
import java.util.Optional;
3327

3428
/**
3529
* Listens for Incoming Messages and stores them in the Message Cache.
@@ -89,7 +83,7 @@ public void cache(Message message) {
8983
* Sends the updated message's content to the {@link MessageCacheConfig#getMessageCacheLogChannel()}.
9084
*
9185
* @param updated The new {@link Message}.
92-
* @param before The {@link CachedMessage}.
86+
* @param before The {@link CachedMessage}.
9387
*/
9488
public void sendUpdatedMessageToLog(Message updated, CachedMessage before) {
9589
if (updated.getContentRaw().trim().equals(before.getMessageContent())) return;
@@ -105,7 +99,7 @@ public void sendUpdatedMessageToLog(Message updated, CachedMessage before) {
10599
/**
106100
* Sends the deleted message's content to the {@link MessageCacheConfig#getMessageCacheLogChannel()}.
107101
*
108-
* @param guild The message's {@link Guild}.
102+
* @param guild The message's {@link Guild}.
109103
* @param channel The message's {@link MessageChannel}.
110104
* @param message The {@link CachedMessage}.
111105
*/
@@ -121,7 +115,7 @@ public void sendDeletedMessageToLog(Guild guild, MessageChannel channel, CachedM
121115
cache.remove(message);
122116
}
123117

124-
private EmbedBuilder buildMessageCacheEmbed(MessageChannel channel, CachedMessage before){
118+
private EmbedBuilder buildMessageCacheEmbed(MessageChannel channel, CachedMessage before) {
125119
long epoch = IdCalculatorCommand.getTimestampFromId(before.getMessageId()) / 1000;
126120
return new EmbedBuilder()
127121
.addField("Channel", channel.getAsMention(), true)
@@ -160,8 +154,8 @@ private MessageEmbed buildMessageDeleteEmbed(Guild guild, User author, MessageCh
160154
/**
161155
* Builds a {@link MessageEmbed} object that is used for messages, that were deleted but not cached.
162156
*
163-
* @param guild The message's guild.
164-
* @param channel The message's channel.
157+
* @param guild The message's guild.
158+
* @param channel The message's channel.
165159
* @param messageId The message's id.
166160
* @return The fully-built {@link MessageEmbed} object.
167161
*/

src/main/java/net/javadiscord/javabot/data/h2db/message_cache/MessageCacheListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void onMessageDelete(@NotNull MessageDeleteEvent event) {
5858

5959
/**
6060
* Checks whether the given message should be ignored by the cache.
61-
*
61+
* <p>
6262
* This is done with the following criteria:
6363
* <ol>
6464
* <li>Message author is a bot</li>

src/main/java/net/javadiscord/javabot/systems/help/dao/HelpTransactionRepository.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
import lombok.extern.slf4j.Slf4j;
55
import net.javadiscord.javabot.systems.help.model.HelpTransaction;
66

7-
import java.sql.*;
7+
import java.sql.Connection;
8+
import java.sql.PreparedStatement;
9+
import java.sql.ResultSet;
10+
import java.sql.SQLException;
811
import java.util.ArrayList;
912
import java.util.List;
1013
import java.util.Optional;

src/main/java/net/javadiscord/javabot/systems/help/model/HelpAccount.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import net.dv8tion.jda.api.entities.Guild;
55
import net.javadiscord.javabot.Bot;
66

7-
import java.util.*;
7+
import java.util.Comparator;
8+
import java.util.Map;
9+
import java.util.Optional;
810

911
/**
1012
* Data class that represents a single Help User Account.

src/main/java/net/javadiscord/javabot/systems/qotw/submissions/subcommands/MarkBestAnswerSubcommand.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package net.javadiscord.javabot.systems.qotw.submissions.subcommands;
22

33
import net.dv8tion.jda.api.EmbedBuilder;
4-
import net.dv8tion.jda.api.entities.*;
4+
import net.dv8tion.jda.api.entities.Member;
5+
import net.dv8tion.jda.api.entities.Message;
6+
import net.dv8tion.jda.api.entities.MessageEmbed;
7+
import net.dv8tion.jda.api.entities.ThreadChannel;
58
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
69
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
710
import net.dv8tion.jda.api.interactions.InteractionHook;

src/main/java/net/javadiscord/javabot/systems/staff/suggestions/SuggestionSubcommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package net.javadiscord.javabot.systems.staff.suggestions;
22

3-
import net.dv8tion.jda.api.entities.*;
3+
import net.dv8tion.jda.api.entities.ChannelType;
4+
import net.dv8tion.jda.api.entities.Message;
5+
import net.dv8tion.jda.api.entities.TextChannel;
46
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
57
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
68
import net.dv8tion.jda.api.interactions.components.ActionRow;

0 commit comments

Comments
 (0)