diff --git a/pom.xml b/pom.xml index b93de2d..70c62a2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.youhavetrouble.noted Noted - 1.0-SNAPSHOT + 1.0 21 diff --git a/src/main/java/me/youhavetrouble/noted/Main.java b/src/main/java/me/youhavetrouble/noted/Main.java index 7351461..d912981 100644 --- a/src/main/java/me/youhavetrouble/noted/Main.java +++ b/src/main/java/me/youhavetrouble/noted/Main.java @@ -14,14 +14,28 @@ import java.util.Collections; import java.util.Properties; import java.util.concurrent.Executors; + public class Main { private static final Properties properties = new Properties(); + private static String version = "Unknown version"; public static JDA jda; public static void main(String[] args) throws InterruptedException { loadProperties(); + try (InputStream resource = Main.class.getClassLoader().getResourceAsStream("version.txt")) { + if (resource != null) { + version = new String(resource.readAllBytes()); + } else { + System.err.println("Version file missing."); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + + System.out.println("Starting " + version); + jda = JDABuilder.createLight(properties.getProperty("DISCORD_TOKEN"), Collections.emptyList()) .setCallbackPool(Executors.newVirtualThreadPerTaskExecutor()) .setActivity(Activity.customStatus("Notekeeping...")) @@ -68,4 +82,8 @@ public class Main { } } + public static String getVersion() { + return version; + } + } \ No newline at end of file