feat: more config
This commit is contained in:
parent
61b3eecc84
commit
b33910a8ef
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,6 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/YADMB.iml" filepath="$PROJECT_DIR$/.idea/modules/YADMB.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/YADMB.main.iml" filepath="$PROJECT_DIR$/.idea/modules/YADMB.main.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/YADMB.main.iml" filepath="$PROJECT_DIR$/.idea/modules/YADMB.main.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/YADMB.test.iml" filepath="$PROJECT_DIR$/.idea/modules/YADMB.test.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/YADMB.test.iml" filepath="$PROJECT_DIR$/.idea/modules/YADMB.test.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
|
|
|
@ -1,9 +1,50 @@
|
||||||
package me.theclashfruit.yadmb.config;
|
package me.theclashfruit.yadmb.config;
|
||||||
|
|
||||||
import io.wispforest.owo.config.annotation.Config;
|
import io.wispforest.owo.config.annotation.Config;
|
||||||
|
import io.wispforest.owo.config.annotation.Nest;
|
||||||
|
|
||||||
@Config(name = "yadmb", wrapperName = "MainConfig")
|
@Config(name = "yadmb", wrapperName = "MainConfig")
|
||||||
public class MainConfigModel {
|
public class MainConfigModel {
|
||||||
public int schemaVersion = 1;
|
public int schemaVersion = 1;
|
||||||
public String discordToken = "";
|
@Nest
|
||||||
|
public Discord discord = new Discord();
|
||||||
|
|
||||||
|
public static class Discord {
|
||||||
|
public String token = "";
|
||||||
|
public long channel = 0;
|
||||||
|
public long guild = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nest
|
||||||
|
public Messages messages = new Messages();
|
||||||
|
|
||||||
|
public static class Messages {
|
||||||
|
@Nest
|
||||||
|
public MessagesDiscord discord = new MessagesDiscord();
|
||||||
|
|
||||||
|
public static class MessagesDiscord {
|
||||||
|
@Nest
|
||||||
|
public ChatMessage chatMessage = new ChatMessage();
|
||||||
|
|
||||||
|
public static class ChatMessage {
|
||||||
|
public String content = "${message}";
|
||||||
|
|
||||||
|
@Nest
|
||||||
|
public Webhook webhook = new Webhook();
|
||||||
|
|
||||||
|
public static class Webhook {
|
||||||
|
public Boolean enabled = true;
|
||||||
|
public String username = "${username}";
|
||||||
|
public String avatarUrl = "https://crafatar.com/avatars/${uuid}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nest
|
||||||
|
public MessagesMinecraft minecraft = new MessagesMinecraft();
|
||||||
|
|
||||||
|
public static class MessagesMinecraft {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class BotClient {
|
||||||
static JDA jda;
|
static JDA jda;
|
||||||
|
|
||||||
public static void createBotClient() throws InterruptedException {
|
public static void createBotClient() throws InterruptedException {
|
||||||
if (YADMB.CONFIG.discordToken().equals("")) {
|
if (YADMB.CONFIG.discord.token().equals("")) {
|
||||||
YADMB.LOGGER.error("Unable to start due to missing discord token!");
|
YADMB.LOGGER.error("Unable to start due to missing discord token!");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -27,7 +27,7 @@ public class BotClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
jda = JDABuilder
|
jda = JDABuilder
|
||||||
.createDefault(YADMB.CONFIG.discordToken(), GatewayIntent.GUILD_MESSAGES, GatewayIntent.MESSAGE_CONTENT)
|
.createDefault(YADMB.CONFIG.discord.token(), GatewayIntent.GUILD_MESSAGES, GatewayIntent.MESSAGE_CONTENT)
|
||||||
.addEventListeners(new ReadyListener())
|
.addEventListeners(new ReadyListener())
|
||||||
.addEventListeners(new MessageListener())
|
.addEventListeners(new MessageListener())
|
||||||
.setActivity(Activity.watching("server to start..."))
|
.setActivity(Activity.watching("server to start..."))
|
||||||
|
|
Loading…
Reference in a new issue