Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion build/scripts/commands/general.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/scripts/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 44 additions & 1 deletion src/commands/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FColor, FishServer, Gamemode, rules, text } from "/config";
import { command, commandList, fail, formatArg, Perm, Req } from "/frameworks/commands";
import type { FishCommandData } from "/frameworks/commands/types";
import { Menu } from "/frameworks/menus";
import { capitalizeText, Duration, escapeTextDiscord, StringBuilder, StringIO, to2DArray } from "/funcs";
import { capitalizeText, Duration, escapeTextDiscord, StringBuilder, StringIO, to2DArray, setToArray } from "/funcs";
import { FishEvents, fishPlugin, fishState, ipPortPattern, recentWhispers, tileHistory, uuidPattern } from "/globals";
import { FMap } from "/maps";
import { FishPlayer } from "/players";
Expand Down Expand Up @@ -1237,5 +1237,48 @@ ${a.hidden ? "This achievement is secret." : ""}\
}
}
},

report: {
args: ["target:player"],
description: 'Report a player to staff with a selected reason.',
perm: Perm.chat,
requirements: ({sender}) => sender.hasPerm("trusted") ? [Req.cooldown(5_000)] : [Req.cooldown(Duration.minutes(2))],
async handler({args: {target}, sender, outputSuccess, outputFail, f}) {
if(target === sender) fail('You cannot report yourself.');
if(target.ranksAtLeast("manager")) fail(`This user cannot be reported in-game.`);

const reasons = [
'Griefing',
'False votekick',
'Harassment',
'Inappropriate content',
'Spam',
'Other', //TODO: use the text input menu
];
if(target.hasPerm("mod")) reasons.push('Admin Abuse');
if(Gamemode.sandbox()) reasons.push("Lag machine");
const reason = await Menu.menu(
'Report Reason',
`Select a reason for reporting ${target.name}`,
reasons,
sender,
{ includeCancel: true }
);

await Menu.confirm(sender, `Are you sure you want to report player ${target.cleanedName}? This action will notify staff members.`);

const message = escapeTextDiscord(
`[In-game report] Server: ${Gamemode.name()}
Issuer: ${sender.cleanedName}
Target: ${target.cleanedName}${target.hasPerm("mod") ? ' (Admin)' : ''}
Reason: ${reason}
${text.reportsPing}`);

api.sendStaffMessage(message, sender.name, (sent) => {
if(sent) outputSuccess(f`Report sent to staff: ${target.name} for "${reason}".`);
else outputFail('Failed to send report to staff. Please try again later.');
});
},
}

});
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const bannedWords: {
"fanum tax", "gyatt", "rizz", "skibidi", //With love, DarthScion
//>:( -dart
"uwu", //lol
// why?? why the uwu??? -starkatt

"nig"+"ger", "nig"+"ga", "niger", "ni8"+"8er", "nig"+"gre", //our apologies to citizens of the Republic of Niger
"негр", "ниггер",
Expand Down