Skip to content

Conversation

@starkatt85
Copy link

as requested

starkatt85 and others added 3 commits January 12, 2026 15:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 12, 2026 10:27
Copy link

Copilot AI left a 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 report command with interactive menu-based player and reason selection
  • Added setToArray to 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.

Comment on lines +1144 to +1148
const onlinePlayers = setToArray(Groups.player);
if(onlinePlayers.length === 0){
outputFail('No players online to report.');
return;
}
Copy link

Copilot AI Jan 12, 2026

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);

Copilot uses AI. Check for mistakes.
outputFail('No players online to report.');
return;
}
const target = await Menu.menu<mindustryPlayer>(
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants