-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
GH-903 Add seen command feature #918
Conversation
Warning Rate limit exceeded@vLuckyyy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 23 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis update adds a new command for checking a player's activity, implemented in a dedicated command class. The command determines if a player is currently online, has played before, or has never joined, and then sends the appropriate message. In addition to the command logic, the update extends the translation functionality by adding a new method to the translation interface and by introducing specific message fields in the English and Polish translation classes. A new messages interface is also added to standardize the notices related to a player's online status, and separate message classes for English and Polish have been created to provide localized content. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (3)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java (1)
32-69
: Consider using a more precise duration format.The duration formatting could be enhanced to show more granular time units for better readability.
Apply this diff to improve duration formatting:
- Duration lastPlayedBetween = Duration.between(Instant.ofEpochMilli(lastPlayed), Instant.now()); - String lastPlayedFormatted = DurationUtil.format(lastPlayedBetween, true); + Duration duration = Duration.between(Instant.ofEpochMilli(lastPlayed), Instant.now()); + String lastPlayedFormatted = DurationUtil.format(duration, true);eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (1)
170-177
: Make placeholder formatting consistent.The placeholders should follow the same style across all messages.
Apply this diff to standardize placeholder formatting:
- public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} have not played before on this server."); + public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} <white>have not played before on this server."); - public Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} was last seen {SEEN} ago."); + public Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} <white>was last seen <green>{SEEN} <white>ago."); - public Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} is now online!"); + public Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} <white>is now online!");eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (1)
194-201
: Keep formatting consistent with English translations.Apply the same formatting improvements as suggested for English translations.
Apply this diff to maintain consistency:
- public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} nie grał nigdy na tym serwerze."); + public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} <white>nie grał nigdy na tym serwerze."); - public Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} był ostatnio widziany {SEEN} temu."); + public Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} <white>był ostatnio widziany <green>{SEEN} <white>temu."); - public Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} jest aktualnie online!"); + public Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} <white>jest aktualnie online!");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
(1 hunks)
🔇 Additional comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java (1)
19-30
: Clean command setup!Good use of dependency injection and proper permission definition.
eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (1)
230-237
: Well-structured translation interface!The new section follows the existing pattern and provides clear message definitions.
0b97152
to
183053e
Compare
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: 0
🧹 Nitpick comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (1)
144-152
: Messages follow a consistent format and provide clear placeholders.Each message:
- Uses consistent styling with
<dark_gray>
brackets and<dark_red>
Seen text- Has clear descriptions for placeholders
- Provides user-friendly feedback
However, consider these minor improvements:
- public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} have not played before on this server."); + public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} has not played before on this server.");eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (1)
149-161
: LGTM! Clean message implementation.The messages:
- Follow consistent formatting with other sections
- Use clear placeholders
- Maintain a consistent color scheme
One suggestion to consider:
- public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} nie grał nigdy na tym serwerze."); - public Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} był ostatnio widziany {SEEN} temu."); - public Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} jest aktualnie online!"); + private static final String PREFIX = "<dark_gray>[<dark_red>Seen<dark_gray>] "; + public Notice neverPlayedBefore = Notice.chat(PREFIX + "<green>{PLAYER} nie grał nigdy na tym serwerze."); + public Notice lastSeen = Notice.chat(PREFIX + "<green>{PLAYER} był ostatnio widziany {SEEN} temu."); + public Notice nowOnline = Notice.chat(PREFIX + "<green>{PLAYER} jest aktualnie online!");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
(2 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
- eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
🔇 Additional comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (1)
134-138
: LGTM! Well-documented section.The section description clearly indicates its purpose for the
/seen
command.eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (1)
143-147
: LGTM! Well-documented section.The new section for the
/seen
command is properly documented with clear descriptions.
eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
Outdated
Show resolved
Hide resolved
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.
Make sure to apply Lucky's suggestion
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
Outdated
Show resolved
Hide resolved
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
Plan: Pro
📒 Files selected for processing (7)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/EnSeenMessages.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/PLSeenMessages.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/SeenMessages.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
(2 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
(2 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
- eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
- eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
- eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
🔇 Additional comments (3)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/SeenMessages.java (1)
5-11
: Nice and clean interface design!The interface is simple and clearly defines the three possible player states we need to handle.
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/EnSeenMessages.java (1)
14-22
: Great message formatting!The messages are well-formatted with:
- Clear descriptions of placeholders
- Consistent color scheme
- Easy-to-read text
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/PLSeenMessages.java (1)
12-23
: Perfect match with the English version!The Polish messages follow the same structure and formatting as the English ones, making the code very consistent.
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/EnSeenMessages.java
Outdated
Show resolved
Hide resolved
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: 0
🧹 Nitpick comments (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/EnSeenMessages.java (1)
14-21
: Consider making the message fields final.Since these messages are set once and shouldn't change, adding the
final
keyword would make this clearer.- public Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} has not played before on this server."); + public final Notice neverPlayedBefore = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} has not played before on this server."); - public Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} was last seen {SEEN} ago."); + public final Notice lastSeen = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} was last seen {SEEN} ago."); - public Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} is now online!"); + public final Notice nowOnline = Notice.chat("<dark_gray>[<dark_red>Seen<dark_gray>] <green>{PLAYER} is now online!");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/EnSeenMessages.java
(1 hunks)
🔇 Additional comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/EnSeenMessages.java (2)
1-8
: Looking good! All imports are clean and necessary.
9-12
: Great job implementing the SeenMessages interface!The annotations look good and you've already addressed the previous review comment.
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
Outdated
Show resolved
Hide resolved
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
Outdated
Show resolved
Hide resolved
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: 0
🧹 Nitpick comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/ENSeenMessages.java (2)
9-11
: Consider making the fields final for better immutability.Since these messages are configuration values that shouldn't change at runtime, marking them as final would be safer.
14-21
: Small formatting fix needed in the lastSeen field.There's an extra space after the equals sign in the lastSeen field initialization.
- public Notice lastSeen = Notice.chat("<green>{PLAYER} was last seen {SEEN} ago."); + public Notice lastSeen = Notice.chat("<green>{PLAYER} was last seen {SEEN} ago.");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/ENSeenMessages.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/PLSeenMessages.java
(1 hunks)eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/PLSeenMessages.java
- eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/SeenCommand.java
- eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
🔇 Additional comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/ENSeenMessages.java (2)
1-8
: Looking good! All imports are clean and necessary.
12-12
:✅ Verification successful
Verify the SeenMessages interface implementation.
Let's make sure the interface exists and this class implements all required methods.
🏁 Script executed:
#!/bin/bash # Search for SeenMessages interface definition ast-grep --pattern 'interface SeenMessages { $$$ }'Length of output: 55
Let's run a broader search with a different tool to be sure the interface exists. Please run the following script:
Once you have the output from this command, review if the interface is defined in your codebase. If the command still returns no output, please verify manually that the
SeenMessages
interface exists.
🏁 Script executed:
#!/bin/bash # A broader search for the SeenMessages interface using ripgrep rg "interface\s+SeenMessages" -n .Length of output: 164
Interface verification complete: SeenMessages exists and is implemented correctly.
- The file
./eternalcore-core/src/main/java/com/eternalcode/core/feature/seen/messages/SeenMessages.java
confirms the interface definition.- The
ENSeenMessages
class properly implements this interface.
Closes #903
Type of change
How Has This Been Tested?