Skip to content

Commit d23baa7

Browse files
authored
Merge pull request #545 from danthe1st/qotw-perms
Automatically update permissions with QOTW
2 parents 1dc8a34 + ab62a39 commit d23baa7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/java/net/discordjug/javabot/systems/qotw/jobs/QOTWCloseSubmissionsJob.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public void execute() throws SQLException {
8282
Permission.CREATE_PRIVATE_THREADS,
8383
Permission.CREATE_PUBLIC_THREADS,
8484
Permission.MESSAGE_ADD_REACTION))
85+
.putPermissionOverride(
86+
qotwConfig.getQOTWReviewRole(),
87+
Set.of(Permission.MESSAGE_SEND_IN_THREADS, Permission.MANAGE_THREADS, Permission.USE_APPLICATION_COMMANDS),
88+
Set.of())
8589
.queue();
8690
TextChannel logChannel = config.getModerationConfig().getLogChannel();
8791
if (logChannel == null) continue;

src/main/java/net/discordjug/javabot/systems/qotw/jobs/QOTWJob.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public void execute() throws SQLException {
6363
Permission.CREATE_PRIVATE_THREADS,
6464
Permission.CREATE_PUBLIC_THREADS,
6565
Permission.MESSAGE_ADD_REACTION))
66+
.removePermissionOverride(qotw.getQOTWReviewRole())
6667
.queue();
6768
if (question.getQuestionNumber() == null) {
6869
question.setQuestionNumber(questionQueueRepository.getNextQuestionNumber());

0 commit comments

Comments
 (0)