added chrom

This commit is contained in:
PxlLoewe
2025-06-05 10:18:52 -07:00
parent 59f3da5c84
commit 63166b602a
9 changed files with 65 additions and 43 deletions

View File

@@ -51,12 +51,15 @@ const handleRoleChange = (action: "add" | "remove") => async (req: Request, res:
? roleIds.filter((id: string) => !currentRoleIds.includes(id))
: roleIds.filter((id: string) => currentRoleIds.includes(id));
console.log(`Attempting to ${action} roles:`, filteredRoleIds, roleIds);
console.log(
`Attempting to ${action} roles: ${filteredRoleIds.join(", ")} to member ${member.nickname || member.user.username}`,
);
// Option to skip if no roles to add/remove
/* if (filteredRoleIds.length === 0) {
if (filteredRoleIds.length === 0) {
console.log(`No roles to ${action}`);
res.status(200).json({ message: `No roles to ${action}` });
return;
} */
}
await member.roles[action](roleIds);
res.status(200).json({ message: `Roles ${action}ed successfully` });