Improved the private thread's starter message and fixed thread deletion · zer0origin/JavaBot@a4ceee9 · GitHub
Skip to content

Commit a4ceee9

Browse files
Improved the private thread's starter message and fixed thread deletion
1 parent 8ee6b5c commit a4ceee9

3 files changed

Lines changed: 51 additions & 12 deletions

File tree

src/main/java/net/javadiscord/javabot/systems/qotw/dao/QuestionQueueRepository.java

Lines changed: 18 additions & 0 deletions

src/main/java/net/javadiscord/javabot/systems/qotw/submissions/SubmissionControlsManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.javadiscord.javabot.Bot;
1313
import net.javadiscord.javabot.command.Responses;
1414
import net.javadiscord.javabot.data.config.guild.QOTWConfig;
15+
import net.javadiscord.javabot.data.h2db.DbHelper;
1516
import net.javadiscord.javabot.systems.qotw.subcommands.qotw_points.IncrementSubcommand;
1617
import net.javadiscord.javabot.systems.qotw.submissions.dao.QOTWSubmissionRepository;
1718
import net.javadiscord.javabot.systems.qotw.submissions.model.QOTWSubmission;
@@ -178,6 +179,7 @@ private void deleteSubmission(ButtonInteractionEvent event, ThreadChannel thread
178179
log.info("{} deleted submission thread {}", event.getUser().getAsTag(), thread.getName());
179180
GuildUtils.getLogChannel(event.getGuild()).sendMessageFormat("%s deleted submission thread `%s`", event.getUser().getAsTag(), thread.getName()).queue();
180181
this.disableControls(String.format("Deleted by %s", event.getUser().getAsTag()), event.getMessage());
182+
DbHelper.doDaoAction(QOTWSubmissionRepository::new, dao -> dao.removeSubmission(thread.getIdLong()));
181183
event.getHook().sendMessage("Submission will be deleted in 10 seconds...").setEphemeral(true);
182184
}
183185

src/main/java/net/javadiscord/javabot/systems/qotw/submissions/SubmissionManager.java

Lines changed: 31 additions & 12 deletions

0 commit comments

Comments
 (0)