|
1 | 1 | package net.javadiscord.javabot.systems.qotw.commands; |
2 | 2 |
|
| 3 | +import java.util.Map; |
| 4 | +import java.util.Set; |
| 5 | + |
3 | 6 | import com.dynxsty.dih4jda.interactions.commands.SlashCommand; |
| 7 | + |
4 | 8 | import net.dv8tion.jda.api.interactions.commands.DefaultMemberPermissions; |
5 | 9 | import net.dv8tion.jda.api.interactions.commands.build.Commands; |
6 | 10 | import net.dv8tion.jda.api.interactions.commands.build.SubcommandGroupData; |
7 | | -import net.javadiscord.javabot.data.config.BotConfig; |
8 | | -import net.javadiscord.javabot.data.h2db.DbHelper; |
9 | | -import net.javadiscord.javabot.systems.notification.NotificationService; |
10 | | -import net.javadiscord.javabot.systems.qotw.QOTWPointsService; |
11 | 11 | import net.javadiscord.javabot.systems.qotw.commands.qotw_points.IncrementPointsSubcommand; |
12 | 12 | import net.javadiscord.javabot.systems.qotw.commands.qotw_points.SetPointsSubcommand; |
13 | 13 | import net.javadiscord.javabot.systems.qotw.commands.questions_queue.AddQuestionSubcommand; |
14 | 14 | import net.javadiscord.javabot.systems.qotw.commands.questions_queue.ListQuestionsSubcommand; |
15 | 15 | import net.javadiscord.javabot.systems.qotw.commands.questions_queue.RemoveQuestionSubcommand; |
16 | | -import net.javadiscord.javabot.systems.qotw.dao.QuestionPointsRepository; |
17 | | -import net.javadiscord.javabot.systems.qotw.dao.QuestionQueueRepository; |
18 | | -import net.javadiscord.javabot.systems.qotw.submissions.dao.QOTWSubmissionRepository; |
19 | 16 | import net.javadiscord.javabot.systems.qotw.submissions.subcommands.MarkBestAnswerSubcommand; |
20 | 17 |
|
21 | | -import java.util.Map; |
22 | | -import java.util.Set; |
23 | | -import java.util.concurrent.ExecutorService; |
24 | | - |
25 | 18 | /** |
26 | 19 | * Represents the `/qotw-admin` command. This holds administrative commands for managing the Question of the Week. |
27 | 20 | */ |
28 | 21 | public class QOTWAdminCommand extends SlashCommand { |
29 | 22 | /** |
30 | 23 | * This classes constructor which sets the {@link net.dv8tion.jda.api.interactions.commands.build.SlashCommandData} and |
31 | 24 | * adds the corresponding {@link net.dv8tion.jda.api.interactions.commands.Command.SubcommandGroup}s. |
32 | | - * @param pointsService The {@link QOTWPointsService} |
33 | | - * @param notificationService The {@link NotificationService} |
34 | | - * @param botConfig The main configuration of the bot |
35 | | - * @param dbHelper An object managing databse operations |
36 | | - * @param qotwPointsRepository Dao object that represents the QOTW_POINTS SQL Table. |
37 | | - * @param questionQueueRepository Dao class that represents the QOTW_QUESTION SQL Table. |
38 | | - * @param asyncPool The main thread pool for asynchronous operations |
39 | | - * @param qotwSubmissionRepository Dao object that represents the QOTW_SUBMISSIONS SQL Table. |
| 25 | + * @param listQuestionsSubcommand /qotw-admin questions-queue list-questions |
| 26 | + * @param addQuestionSubcommand /qotw-admin questions-queue add |
| 27 | + * @param removeQuestionSubcommand /qotw-admin questions-queue remove |
| 28 | + * @param incrementPointsSubcommand /qotw-admin account increment |
| 29 | + * @param setPointsSubcommand /qotw-admin account set |
| 30 | + * @param markBestAnswerSubcommand /qotw-admin submissions mark-best |
40 | 31 | */ |
41 | | - public QOTWAdminCommand(QOTWPointsService pointsService, NotificationService notificationService, BotConfig botConfig, DbHelper dbHelper, QuestionPointsRepository qotwPointsRepository, QuestionQueueRepository questionQueueRepository, ExecutorService asyncPool, QOTWSubmissionRepository qotwSubmissionRepository) { |
| 32 | + public QOTWAdminCommand(ListQuestionsSubcommand listQuestionsSubcommand, AddQuestionSubcommand addQuestionSubcommand, RemoveQuestionSubcommand removeQuestionSubcommand, IncrementPointsSubcommand incrementPointsSubcommand, SetPointsSubcommand setPointsSubcommand, MarkBestAnswerSubcommand markBestAnswerSubcommand) { |
42 | 33 | setSlashCommandData(Commands.slash("qotw-admin", "Administrative tools for managing the Question of the Week.") |
43 | 34 | .setDefaultPermissions(DefaultMemberPermissions.DISABLED) |
44 | 35 | .setGuildOnly(true) |
45 | 36 | ); |
46 | 37 | addSubcommandGroups(Map.of( |
47 | | - new SubcommandGroupData("questions-queue", "Commands for interacting with the set of QOTW questions that are in queue."), Set.of(new ListQuestionsSubcommand(questionQueueRepository, asyncPool), new AddQuestionSubcommand(questionQueueRepository, asyncPool), new RemoveQuestionSubcommand(questionQueueRepository)), |
48 | | - new SubcommandGroupData("account", "Commands for interaction with Users Question of the Week points."), Set.of(new IncrementPointsSubcommand(pointsService, notificationService), new SetPointsSubcommand(pointsService, dbHelper.getDataSource(), qotwPointsRepository)), |
49 | | - new SubcommandGroupData("submissions", "Commands for managing QOTW Submissions."), Set.of(new MarkBestAnswerSubcommand(pointsService, notificationService, botConfig, asyncPool, qotwSubmissionRepository)) |
| 38 | + new SubcommandGroupData("questions-queue", "Commands for interacting with the set of QOTW questions that are in queue."), Set.of(listQuestionsSubcommand, addQuestionSubcommand, removeQuestionSubcommand), |
| 39 | + new SubcommandGroupData("account", "Commands for interaction with Users Question of the Week points."), Set.of(incrementPointsSubcommand, setPointsSubcommand), |
| 40 | + new SubcommandGroupData("submissions", "Commands for managing QOTW Submissions."), Set.of(markBestAnswerSubcommand) |
50 | 41 | )); |
51 | 42 | } |
52 | 43 | } |
0 commit comments