Skip to content

Commit a65e393

Browse files
committed
TransferQuestionCommand now makes use of ForumPoster
Introduced a forum management API. TransferQuestionCommand now makes use of it. See #1307
1 parent 5b087df commit a65e393

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

application/src/main/java/org/togetherjava/tjbot/features/moderation/TransferQuestionCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.togetherjava.tjbot.features.CommandVisibility;
3333
import org.togetherjava.tjbot.features.MessageContextCommand;
3434
import org.togetherjava.tjbot.features.chatgpt.ChatGptService;
35+
import org.togetherjava.tjbot.features.utils.ForumPoster;
3536
import org.togetherjava.tjbot.features.utils.StringDistances;
3637

3738
import java.awt.Color;
@@ -233,7 +234,8 @@ private RestAction<ForumPostData> createForumPost(ModalInteractionEvent event,
233234
ForumTag tag = getTagOrDefault(questionsForum.getAvailableTagsByName(queryTag, true),
234235
() -> questionsForum.getAvailableTagsByName(mostCommonTag, true).getFirst());
235236

236-
return questionsForum.createForumPost(forumTitle, forumMessage)
237+
return ForumPoster.using(event.getJDA())
238+
.createPost(questionsForum, forumTitle, forumMessage)
237239
.setTags(ForumTagSnowflake.fromId(tag.getId()))
238240
.map(createdPost -> new ForumPostData(createdPost, originalUser));
239241
}

0 commit comments

Comments
 (0)