From fb752fb9a91c34dc434291ef6c2666b0603e41d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Sun, 15 Jan 2023 00:40:19 +0100 Subject: [PATCH] Fix code style error --- src/main/java/wtf/beatrice/hidekobot/Cache.java | 10 +++++----- .../beatrice/hidekobot/commands/base/MagicBall.java | 2 +- .../wtf/beatrice/hidekobot/commands/base/Trivia.java | 4 ++-- .../hidekobot/commands/base/UserPunishment.java | 4 ++-- .../beatrice/hidekobot/datasources/DatabaseSource.java | 2 +- .../beatrice/hidekobot/listeners/MessageLogger.java | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/Cache.java b/src/main/java/wtf/beatrice/hidekobot/Cache.java index 09bae87..1fa3604 100644 --- a/src/main/java/wtf/beatrice/hidekobot/Cache.java +++ b/src/main/java/wtf/beatrice/hidekobot/Cache.java @@ -43,10 +43,10 @@ public class Cache private static boolean verbose = false; private static MessageLogger verbosityLogger = null; private static final long botMaintainerId = 979809420714332260L; - private final static String expiryTimestampFormat = "yy/MM/dd HH:mm:ss"; + private static final String expiryTimestampFormat = "yy/MM/dd HH:mm:ss"; // note: discord sets interactions' expiry time to 15 minutes by default, so we can't go higher than that. - private final static long expiryTimeSeconds = 30L; + private static final long expiryTimeSeconds = 30L; // used to count e.g. uptime private static LocalDateTime startupTime = null; @@ -55,16 +55,16 @@ public class Cache private static final LocalDateTime botBirthDate = LocalDateTime.of(2022, 8, 25, 21, 50); // the scheduler that should always be used when running a scheduled task. - private final static ScheduledExecutorService taskScheduler = Executors.newSingleThreadScheduledExecutor(); // todo: try-with-resources + private static final ScheduledExecutorService taskScheduler = Executors.newSingleThreadScheduledExecutor(); // todo: try-with-resources - private final static String execPath = System.getProperty("user.dir"); + private static final String execPath = System.getProperty("user.dir"); private static final String botName = "Hideko"; private static SlashCommandListener slashCommandListener = null; private static SlashCommandCompletionListener slashCommandCompletionListener = null; private static MessageCommandListener messageCommandListener = null; - private final static String defaultInviteLink = + private static final String defaultInviteLink = "https://discord.com/api/oauth2/authorize?client_id=%userid%&scope=bot+applications.commands&permissions=8"; private static String botApplicationId = ""; diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java b/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java index 8678ed1..e03e1ab 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/base/MagicBall.java @@ -19,7 +19,7 @@ public class MagicBall return new LinkedList<>(Arrays.asList("8ball", "8b", "eightball", "magicball")); } - private final static List answers = new ArrayList<>( + private static final List answers = new ArrayList<>( Arrays.asList("It is certain.", "It is decidedly so.", "Without a doubt.", diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/base/Trivia.java b/src/main/java/wtf/beatrice/hidekobot/commands/base/Trivia.java index e33ad32..db5a6c0 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/base/Trivia.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/base/Trivia.java @@ -34,8 +34,8 @@ import java.util.concurrent.TimeUnit; public class Trivia { - private final static String triviaLink = "https://opentdb.com/api.php?amount=10&type=multiple&category="; - private final static String categoriesLink = "https://opentdb.com/api_category.php"; + private static final String triviaLink = "https://opentdb.com/api.php?amount=10&type=multiple&category="; + private static final String categoriesLink = "https://opentdb.com/api_category.php"; public static List channelsRunningTrivia = new ArrayList<>(); diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/base/UserPunishment.java b/src/main/java/wtf/beatrice/hidekobot/commands/base/UserPunishment.java index 6ec2cf8..c46068a 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/base/UserPunishment.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/base/UserPunishment.java @@ -27,8 +27,8 @@ import java.util.concurrent.TimeUnit; public class UserPunishment { - private final static Duration maxTimeoutDuration = Duration.of(28, ChronoUnit.DAYS); - private final static Duration minTimeoutDuration = Duration.of(30, ChronoUnit.SECONDS); + private static final Duration maxTimeoutDuration = Duration.of(28, ChronoUnit.DAYS); + private static final Duration minTimeoutDuration = Duration.of(30, ChronoUnit.SECONDS); public static void handle(SlashCommandInteractionEvent event, PunishmentType punishmentType) { diff --git a/src/main/java/wtf/beatrice/hidekobot/datasources/DatabaseSource.java b/src/main/java/wtf/beatrice/hidekobot/datasources/DatabaseSource.java index 912fda6..fb82d71 100644 --- a/src/main/java/wtf/beatrice/hidekobot/datasources/DatabaseSource.java +++ b/src/main/java/wtf/beatrice/hidekobot/datasources/DatabaseSource.java @@ -15,7 +15,7 @@ import java.util.List; public class DatabaseSource { - private final static String sqliteURL = "jdbc:sqlite:%path%"; + private static final String sqliteURL = "jdbc:sqlite:%path%"; private Connection dbConnection = null; private final String dbPath; private final Logger logger; diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java index 84db285..a01b53c 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java @@ -12,8 +12,8 @@ public class MessageLogger extends ListenerAdapter { // this class only gets loaded as a listener if verbosity is set to true on startup. - private final static String guildChannelFormat = "[%guild%] [#%channel%] %user%: %message%"; - private final static String dmFormat = "[DM] %user%: %message%"; + private static final String guildChannelFormat = "[%guild%] [#%channel%] %user%: %message%"; + private static final String dmFormat = "[DM] %user%: %message%"; private final Logger logger = new Logger(MessageLogger.class);