Compare commits
No commits in common. "d95338d8337f1e151bacffed81b03617e5995a3c" and "5d34048ae6e06f09705670b81eb532dd7f76498a" have entirely different histories.
d95338d833
...
5d34048ae6
13
.drone.yml
13
.drone.yml
@ -1,13 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
name: default
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: maven:3-eclipse-temurin-16
|
|
||||||
commands:
|
|
||||||
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
|
|
||||||
- mvn test -B
|
|
10
pom.xml
10
pom.xml
@ -20,16 +20,6 @@
|
|||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>5.0.0-alpha.18</version>
|
<version>5.0.0-alpha.18</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<version>2.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-simple</artifactId>
|
|
||||||
<version>2.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -2,23 +2,20 @@ package wtf.beatrice.hidekobot;
|
|||||||
|
|
||||||
import net.dv8tion.jda.api.JDA;
|
import net.dv8tion.jda.api.JDA;
|
||||||
import net.dv8tion.jda.api.JDABuilder;
|
import net.dv8tion.jda.api.JDABuilder;
|
||||||
import wtf.beatrice.hidekobot.utils.Logger;
|
|
||||||
|
|
||||||
import javax.security.auth.login.LoginException;
|
import javax.security.auth.login.LoginException;
|
||||||
|
|
||||||
public class HidekoBot
|
public class HidekoBot
|
||||||
{
|
{
|
||||||
private static Logger logger = new Logger(HidekoBot.class);
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
JDA jda = JDABuilder.createDefault("").build();
|
JDA jda = JDABuilder.createDefault("token").build();
|
||||||
} catch (LoginException e)
|
} catch (LoginException e)
|
||||||
{
|
{
|
||||||
logger.log(e.getMessage());
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
package wtf.beatrice.hidekobot.utils;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
|
|
||||||
public class Logger
|
|
||||||
{
|
|
||||||
|
|
||||||
// objects that we need to have for a properly formatted message
|
|
||||||
private String className;
|
|
||||||
private final String format = "[%date%] [%class%] %message%";
|
|
||||||
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM-dd");
|
|
||||||
|
|
||||||
|
|
||||||
// when initializing a new logger, save variables in that instance
|
|
||||||
public Logger(Class logClass)
|
|
||||||
{
|
|
||||||
className = logClass.getSimpleName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// log a message to console, with our chosen format
|
|
||||||
public void log(String message)
|
|
||||||
{
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
String currentTime = formatter.format(now);
|
|
||||||
System.out.println(format
|
|
||||||
.replace("%date%", currentTime)
|
|
||||||
.replace("%class%", className)
|
|
||||||
.replace("%message%", message));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user