Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for parsing clan tags/prefixes in player names for Minecraft chat messages. The implementation extracts usernames from messages where players have clan tags or prefixes before their names (e.g., <[CLAN] PlayerName>).
Changes:
- Modified
parseUsernameto extract the last token when spaces are present (clan tags typically come before usernames) - Added fallback logic in message parsing to handle clan tag formats like
<[CLAN] username> - Updated
removePlayerFromMsgto handle clan tags within angle brackets
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/structure/mineflayer/utils/parseUsername.ts |
Extracts username from strings containing clan tags by taking the last space-separated token and renamed variable from name to cleanedName |
src/events/mineflayer/messagestr.ts |
Adds fallback parsing for clan tag format <clan username> to extract usernames and messages |
src/events/mineflayer/message.ts |
Updates player name removal logic to handle clan tags inside angle brackets with word boundary matching |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (cleanedName.startsWith("<")) { | ||
| cleanedName = cleanedName.slice(1); | ||
| } |
There was a problem hiding this comment.
This check for a leading "<" character will never match because the previous line (line 12) already removes all non-word characters, underscores, and numbers. The regex [^_\w\d] removes all special characters including "<", so by the time this check runs, any "<" character would already be removed. This check should either be moved before line 12, or removed entirely if it's no longer needed.
- !q now supports server/all scope - add !lq to list quotable servers - add !rqa for random quote across all servers
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
…fully Handle whois 400 “No user found” without bot restarts "Alr u can merge it Code is fine Idk how well it will work tho lol Without actually reading it carefully" -Bacon
…ror-gracefully Revert "Handle whois 400 “No user found” without bot restarts" Reverting copilot code that didn't work.
… the FIRST word in the message.
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
… filtering Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
… filter Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
…afety Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tions Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
… correctly Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
Co-authored-by: BaconCat1 <126538523+BaconCat1@users.noreply.github.com>
No description provided.