mirror of
https://github.com/Noratrieb/killua-bot.git
synced 2026-01-16 16:15:03 +01:00
config changes
This commit is contained in:
parent
c27f518e33
commit
3e890e50ce
2 changed files with 34 additions and 18 deletions
|
|
@ -7,15 +7,18 @@ import net.dv8tion.jda.api.entities.User;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
|
public static String TOKEN;
|
||||||
|
public static String PREFIX;
|
||||||
|
public static String JSON_PATH;
|
||||||
|
|
||||||
public static final String NORMAL_PREFIX = "kil ";
|
public static final String NORMAL_PREFIX = "kil ";
|
||||||
public static final String L_PREFIX = "k ";
|
public static final String L_PREFIX = "k ";
|
||||||
|
|
||||||
public static final String VERSION = "1.0.0";
|
public static final String VERSION = "1.0.1";
|
||||||
|
|
||||||
public static final String PREFIX = NORMAL_PREFIX;
|
|
||||||
|
|
||||||
public static final Color DEFAULT_COLOR = new Color(229, 201, 255);
|
public static final Color DEFAULT_COLOR = new Color(229, 201, 255);
|
||||||
|
|
||||||
|
|
@ -25,19 +28,7 @@ public class Config {
|
||||||
public static final long KUKUROO_MOUNTAIN_ID = 799696420386504795L;
|
public static final long KUKUROO_MOUNTAIN_ID = 799696420386504795L;
|
||||||
public static final long TRIVIA_APPROVAL_CHANNEL_ID = 802244298774413312L;
|
public static final long TRIVIA_APPROVAL_CHANNEL_ID = 802244298774413312L;
|
||||||
|
|
||||||
private static String JSON_PATH_JAR;
|
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
JSON_PATH_JAR = new File(TriviaQuestionData.class.getProtectionDomain().getCodeSource()
|
|
||||||
.getLocation().toURI()).getPath().replaceAll("(.*\\\\).*?\\.jar", "$1") + "trivia_questions.json";
|
|
||||||
} catch (URISyntaxException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String JSON_PATH_INTELLIJ = "trivia_questions.json";
|
private static final String JSON_PATH_INTELLIJ = "trivia_questions.json";
|
||||||
public static final String JSON_PATH = JSON_PATH_JAR;
|
|
||||||
|
|
||||||
private static JDA jda;
|
private static JDA jda;
|
||||||
|
|
||||||
|
|
@ -52,9 +43,33 @@ public class Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
EmbedBuilder builder = new EmbedBuilder();
|
EmbedBuilder builder = new EmbedBuilder();
|
||||||
builder.setColor(Config.DEFAULT_COLOR).
|
builder.setColor(Config.DEFAULT_COLOR)
|
||||||
setThumbnail(killua.getAvatarUrl())
|
.setThumbnail(killua.getAvatarUrl())
|
||||||
.setFooter("KilluaBot");
|
.setFooter("KilluaBot");
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 = normal
|
||||||
|
* 1 = test
|
||||||
|
*/
|
||||||
|
public static void init(int level) {
|
||||||
|
switch (level) {
|
||||||
|
case 0 -> {
|
||||||
|
PREFIX = NORMAL_PREFIX;
|
||||||
|
TOKEN = Secrets.NORMAL_TOKEN;
|
||||||
|
try {
|
||||||
|
JSON_PATH = new File(TriviaQuestionData.class.getProtectionDomain().getCodeSource()
|
||||||
|
.getLocation().toURI()).getPath().replaceAll("(.*\\\\).*?\\.jar", "$1") + "trivia_questions.json";
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException("Trivia questions not found", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1 -> {
|
||||||
|
PREFIX = L_PREFIX;
|
||||||
|
TOKEN = Secrets.L_TOKEN;
|
||||||
|
JSON_PATH = JSON_PATH_INTELLIJ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ import java.util.Scanner;
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) throws LoginException {
|
public static void main(String[] args) throws LoginException {
|
||||||
JDABuilder builder = JDABuilder.createDefault(Secrets.TOKEN);
|
Config.init(1);
|
||||||
|
JDABuilder builder = JDABuilder.createDefault(Config.TOKEN);
|
||||||
builder.setCompression(Compression.ZLIB);
|
builder.setCompression(Compression.ZLIB);
|
||||||
builder.setActivity(Activity.watching("over Gon"));
|
builder.setActivity(Activity.watching("over Gon"));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue