Skip to content

Commit c5e6fd1

Browse files
committed
MCSManager Bot V.1.0.0
1 parent aa7ecc0 commit c5e6fd1

29 files changed

Lines changed: 256 additions & 1485 deletions

WARP.md

Lines changed: 0 additions & 141 deletions
This file was deleted.

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ plugins {
44
id("com.gradleup.shadow") version "8.3.1"
55
}
66

7-
application.mainClass = "de.skyking_px.PhoenixBot.Bot"
8-
group = "de.skyking_px"
9-
version = "2.0.0-rc6"
7+
application.mainClass = "com.mcsmanager.bot.Bot"
8+
group = "com.mcsmanager"
9+
version = "1.0.0"
1010

1111
repositories {
1212
mavenCentral()

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
rootProject.name = "PhoenixBot"
1+
rootProject.name = "MCSM-DC-Bot"
22

src/main/java/de/skyking_px/PhoenixBot/Bot.java renamed to src/main/java/com/mcsmanager/bot/Bot.java

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
package de.skyking_px.PhoenixBot;
1+
package com.mcsmanager.bot;
22

3-
import de.skyking_px.PhoenixBot.command.CloseCommand;
4-
import de.skyking_px.PhoenixBot.command.FAQCommand;
5-
import de.skyking_px.PhoenixBot.command.InfoCommand;
6-
import de.skyking_px.PhoenixBot.command.TBSCommand;
7-
import de.skyking_px.PhoenixBot.faq.FaqHandler;
8-
import de.skyking_px.PhoenixBot.listener.BugReportListener;
9-
import de.skyking_px.PhoenixBot.listener.SuggestionListener;
10-
import de.skyking_px.PhoenixBot.listener.SupportListener;
11-
import de.skyking_px.PhoenixBot.listener.ThreadDeleteListener;
12-
import de.skyking_px.PhoenixBot.storage.TicketStorage;
13-
import de.skyking_px.PhoenixBot.storage.VoteStorage;
14-
import de.skyking_px.PhoenixBot.ticket.Panel;
15-
import de.skyking_px.PhoenixBot.util.*;
3+
import com.mcsmanager.bot.command.CloseCommand;
4+
import com.mcsmanager.bot.command.FAQCommand;
5+
import com.mcsmanager.bot.command.InfoCommand;
6+
import com.mcsmanager.bot.faq.FaqHandler;
7+
import com.mcsmanager.bot.listener.BugReportListener;
8+
import com.mcsmanager.bot.listener.SuggestionListener;
9+
import com.mcsmanager.bot.listener.SupportListener;
10+
import com.mcsmanager.bot.listener.ThreadDeleteListener;
11+
import com.mcsmanager.bot.util.CloseHandler;
12+
import com.mcsmanager.bot.util.LogUploader;
13+
import com.mcsmanager.bot.util.LogUtils;
14+
import com.mcsmanager.bot.util.Reload;
15+
import com.mcsmanager.bot.storage.VoteStorage;
1616
import net.dv8tion.jda.api.JDA;
1717
import net.dv8tion.jda.api.JDABuilder;
1818
import net.dv8tion.jda.api.OnlineStatus;
@@ -22,20 +22,18 @@
2222
import java.io.IOException;
2323

2424
/**
25-
* Main Bot class for the PhoenixBot Discord application.
25+
* Main Bot class for the MCSM Discord Bot Discord application.
2626
* This class initializes the bot, registers event listeners, and configures JDA.
2727
*
2828
* @author SkyKing_PX
2929
*/
3030
public class Bot {
3131
/** Current version of the bot */
32-
public static final String VERSION = "2.0.0-rc6";
32+
public static final String VERSION = "1.0.0";
3333

3434

3535
/** Storage for vote data across suggestion forums */
3636
private static VoteStorage voteStorage;
37-
/** Storage for ticket data and tracking */
38-
private static TicketStorage ticketStorage;
3937

4038
/**
4139
* Initializes the storage systems for votes and tickets.
@@ -51,13 +49,6 @@ public static void initStorage() {
5149
LogUtils.logFatalException("Error initializing vote storage", e);
5250
}
5351
LogUtils.logStorage("Initialized", "Vote Storage");
54-
LogUtils.logStorage("Initializing...", "Ticket Storage");
55-
try {
56-
ticketStorage = new TicketStorage();
57-
} catch (Exception e) {
58-
LogUtils.logFatalException("Error initializing ticket storage", e);
59-
}
60-
LogUtils.logStorage("Initializing", "Ticket Storage");
6152
}
6253

6354
/**
@@ -68,29 +59,26 @@ public static void initStorage() {
6859
public static VoteStorage getVoteStorage() {
6960
return voteStorage;
7061
}
71-
72-
/**
73-
* Gets the ticket storage instance for managing support tickets.
74-
*
75-
* @return The ticket storage instance
76-
*/
77-
public static TicketStorage getTicketStorage() {
78-
return ticketStorage;
79-
}
8062

8163
/**
82-
* Main entry point for the PhoenixBot application.
64+
* Main entry point for the MCSM Discord Bot application.
8365
* Initializes storage, configures JDA, and registers all event listeners.
8466
*
8567
* @param args Command line arguments (not used)
8668
* @throws Exception If any error occurs during initialization
8769
*/
8870
public static void main(String[] args) throws Exception {
8971
initStorage();
72+
String activity = "Incorrect Configuration";
73+
try {
74+
activity = Config.get().getBot().getActivity();
75+
activity = activity.replace("{Version}", Bot.VERSION);
76+
} catch (Exception e) {
77+
LogUtils.logException("Error while getting Bot Activity from Config. It may be corrupt.", e);
78+
}
9079

9180
JDA api = JDABuilder.createDefault(Config.get().getBot().getToken())
9281
.addEventListeners(
93-
new TBSCommand(),
9482
new InfoCommand(),
9583
new FAQCommand(),
9684
new LogUploader(),
@@ -102,11 +90,9 @@ public static void main(String[] args) throws Exception {
10290
new CloseHandler(),
10391
new FaqHandler(),
10492
new Reload(),
105-
new Panel(),
106-
new TicketCloseHandler(),
10793
new ThreadDeleteListener())
10894
.enableIntents(GatewayIntent.MESSAGE_CONTENT)
109-
.setActivity(Activity.playing(Config.get().getBot().getActivity()))
95+
.setActivity(Activity.playing(activity))
11096
.setStatus(OnlineStatus.ONLINE)
11197
.build();
11298
}

src/main/java/de/skyking_px/PhoenixBot/Config.java renamed to src/main/java/com/mcsmanager/bot/Config.java

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package de.skyking_px.PhoenixBot;
1+
package com.mcsmanager.bot;
22

3-
import de.skyking_px.PhoenixBot.faq.FaqEntry;
4-
import de.skyking_px.PhoenixBot.util.LogUtils;
3+
import com.mcsmanager.bot.faq.FaqEntry;
4+
import com.mcsmanager.bot.util.LogUtils;
55
import org.yaml.snakeyaml.LoaderOptions;
66
import org.yaml.snakeyaml.Yaml;
77
import org.yaml.snakeyaml.constructor.Constructor;
@@ -13,7 +13,7 @@
1313
import java.nio.file.Paths;
1414

1515
/**
16-
* Configuration management class for the PhoenixBot application.
16+
* Configuration management class for the MCSM Discord Bot application.
1717
* Uses YAML format for configuration storage with automatic default generation.
1818
* Implements singleton pattern for global configuration access.
1919
*
@@ -39,8 +39,6 @@ public class Config {
3939
private Support support;
4040
/** FAQ system configuration */
4141
private Faq faq;
42-
/** Ticket system configuration */
43-
private Tickets tickets;
4442
/** Embed system configuration */
4543
private Embeds embeds;
4644

@@ -83,7 +81,6 @@ private void load() throws IOException {
8381
this.bugReport = loaded.bugReport;
8482
this.support = loaded.support;
8583
this.faq = loaded.faq;
86-
this.tickets = loaded.tickets;
8784
this.embeds = loaded.embeds;
8885
}
8986
}
@@ -113,39 +110,36 @@ private void createDefaultConfig() throws IOException {
113110
guild_id: "YOUR_DISCORD_GUILD_ID"
114111
115112
logging:
116-
logChannelId: "1353805483428937738"
117-
fatalLogChannelId: "1119148633409986562"
113+
logChannelId: "0000000000000000000"
114+
fatalLogChannelId: "0000000000000000000"
118115
119116
voting:
120-
suggestions_forum_id: "1347456623576092764"
117+
suggestions_forum_id: "0000000000000000000"
121118
122119
support:
123-
support_forum_id: "1347289412060582031"
120+
support_forum_id: "0000000000000000000"
124121
125122
bugReport:
126-
bugReport_forum_id: "1349267451883556894"
123+
bugReport_forum_id: "0000000000000000000"
127124
128125
roles:
129-
moderators: ["1123224840426500228"]
126+
moderators: ["0000000000000000000"]
130127
131128
faq:
132-
faq_channel_id: "1347477305806557196"
129+
faq_channel_id: "0000000000000000000"
133130
faq_entries:
134131
- question: "Q: ?"
135132
answer: "**A:** ."
136133
imageUrl: ""
137134
thumbnailUrl: ""
138-
139-
tickets:
140-
pingRoles: ["1416379517928476773", "1123224748571238430"]
141135
142136
embeds:
143-
defaultColor: "#2073cb"
137+
defaultColor: "#454040"
144138
successColor: "#00ff33"
145139
errorColor: "#ff0000"
146140
warningColor: "#ff9900"
147141
infoColor: "#ffcc33"
148-
footerText: "Phoenix Bot | Developed by SkyKing_PX"
142+
footerText: "MCSManager Bot | Version {Version}"
149143
""";
150144

151145
Files.writeString(CONFIG_PATH, defaultConfig);
@@ -189,11 +183,6 @@ private void createDefaultConfig() throws IOException {
189183
/** @param faq FAQ configuration to set */
190184
public void setFaq(Faq faq) { this.faq = faq; }
191185

192-
/** @return Ticket system configuration */
193-
public Tickets getTickets() { return tickets; }
194-
/** @param tickets Ticket configuration to set */
195-
public void setTickets(Tickets tickets) { this.tickets = tickets; }
196-
197186
/** @return Embed system configuration */
198187
public Embeds getEmbeds() { return embeds; }
199188
/** @param embeds Embed configuration to set */
@@ -308,18 +297,6 @@ public static class Faq {
308297
public void setFaq_entries(FaqEntry[] faq_entries) { this.faq_entries = faq_entries; }
309298
}
310299

311-
/**
312-
* Ticket system configuration.
313-
*/
314-
public static class Tickets {
315-
/** Array of Discord role IDs to ping when tickets are created */
316-
private String[] pingRoles;
317-
/** @return Array of role IDs to ping for tickets */
318-
public String[] getPingRoles() { return pingRoles; }
319-
/** @param pingRoles Array of role IDs to set for ticket pings */
320-
public void setPingRoles(String[] pingRoles) { this.pingRoles = pingRoles; }
321-
}
322-
323300
/**
324301
* Embed system configuration.
325302
*/

0 commit comments

Comments
 (0)