This commit is contained in:
= 2024-03-12 23:53:29 +00:00
parent 3be2585094
commit 8649e0a003
5 changed files with 54 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
token.txt
app.jar
target/
!.mvn/wrapper/maven-wrapper.jar

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM eclipse-temurin:17
RUN mkdir -p /opt/duke-syndicate/duke-bot
COPY target/untitled-1.0-SNAPSHOT.jar /opt/duke-syndicate/duke-bot/app.jar
COPY target/final /opt/duke-syndicate/duke-bot
WORKDIR /opt/duke-syndicate/duke-bot
CMD ["java", "-jar", "/opt/duke-syndicate/duke-bot/app.jar"]

37
pom.xml
View File

@ -22,4 +22,41 @@
<version>5.0.0-beta.21</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/final/libraries/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>libraries/</classpathPrefix>
<mainClass>hard.rock.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -8,7 +8,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) throws IOException {
public static void main(String[] args) throws IOException, InterruptedException {
String token = new String(Main.class.getResourceAsStream("/token.txt").readAllBytes(), StandardCharsets.UTF_8);
JDABuilder builder = JDABuilder.createDefault(token)