-
Notifications
You must be signed in to change notification settings - Fork 16
Feat.report command #165
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
base: master
Are you sure you want to change the base?
Feat.report command #165
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
This PR adds a new /report command that allows players to report other players to staff with selectable reasons.
Changes:
- Added a new
reportcommand with interactive menu-based player and reason selection - Added
setToArrayto imports in general.ts to support converting player groups to arrays - Added a humorous comment in config.ts
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/config.ts | Added a humorous comment questioning the "uwu" banned word |
| src/commands/general.ts | Implemented the new report command with menu-based player and reason selection, integrated with the staff messaging API |
| build/scripts/config.js | Compiled JavaScript version of the config.ts comment change |
| build/scripts/commands/general.js | Compiled JavaScript version of the new report command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const onlinePlayers = setToArray(Groups.player); | ||
| if(onlinePlayers.length === 0){ | ||
| outputFail('No players online to report.'); | ||
| return; | ||
| } |
Copilot
AI
Jan 12, 2026
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.
The check for no players online does not account for the case where the sender is the only player online. In this scenario, the menu will be shown with only the sender as an option, and the error "You cannot report yourself" will only be displayed after the user selects themselves. Consider filtering out the sender from onlinePlayers before checking the length, or checking if there are any other players besides the sender. For example: const onlinePlayers = setToArray(Groups.player).filter(p => p !== sender.player);
| outputFail('No players online to report.'); | ||
| return; | ||
| } | ||
| const target = await Menu.menu<mindustryPlayer>( |
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.
You've written custom logic to select a player with a menu. The commands framework handles this automatically: specify args: ["player:player"] and it will do this without any extra code.
as requested