-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 다른 슬래시 커맨드 사용시 호출되지 않도록 수정 #587
Conversation
Walkthrough
Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/main/java/com/gdschongik/gdsc/domain/discord/application/listener/DiscordIdBatchCommandListener.java (2 hunks)
Additional comments not posted (1)
src/main/java/com/gdschongik/gdsc/domain/discord/application/listener/DiscordIdBatchCommandListener.java (1)
3-3
: 좋은 변경 사항입니다: static import 추가
DiscordConstant
의 static import를 추가하여 코드 가독성을 향상시켰습니다.
if (event.getName().equals(COMMAND_NAME_BATCH_DISCORD_ID)) { | ||
discordIdBatchCommandHandler.delegate(event); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 변경 사항입니다: 조건부 체크 추가
onSlashCommandInteraction
메서드에 조건부 체크를 추가하여, 이벤트 이름이 COMMAND_NAME_BATCH_DISCORD_ID
와 일치할 때만 delegate
메서드가 호출되도록 했습니다. 이를 통해 불필요한 명령 처리를 방지할 수 있습니다.
제안: 조건부 체크 가독성 개선
조건부 체크의 가독성을 높이기 위해, 조건문을 별도의 메서드로 추출하는 것을 고려해보세요.
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
if (isBatchDiscordIdCommand(event)) {
discordIdBatchCommandHandler.delegate(event);
}
}
private boolean isBatchDiscordIdCommand(SlashCommandInteractionEvent event) {
return event.getName().equals(COMMAND_NAME_BATCH_DISCORD_ID);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
🌱 관련 이슈
📌 작업 내용 및 특이사항
📝 참고사항
📚 기타
Summary by CodeRabbit
새로운 기능
버그 수정