- Introduced global command channel whitelist and blacklist in the GuildSettings model for improved command access control. - Implemented command gate logic in the command routing to handle channel and role restrictions, providing user feedback for denied commands. - Enhanced the CommandsManager component to support global rules and channel/role selection, improving the user interface for managing command permissions. - Updated localization files to include new keys for global command rules and related messages, ensuring clarity in user interactions.
19 lines
596 B
TypeScript
19 lines
596 B
TypeScript
import { type NextRequest, NextResponse } from 'next/server';
|
|
import { requireGuildAccess, toApiErrorResponse } from '@/lib/auth';
|
|
import { listGuildRolesForDashboard } from '@/lib/discord-guild-resources';
|
|
|
|
interface RouteParams {
|
|
params: Promise<{ guildId: string }>;
|
|
}
|
|
|
|
export async function GET(_request: NextRequest, { params }: RouteParams) {
|
|
const { guildId } = await params;
|
|
try {
|
|
await requireGuildAccess(guildId);
|
|
const roles = await listGuildRolesForDashboard(guildId);
|
|
return NextResponse.json(roles);
|
|
} catch (error) {
|
|
return toApiErrorResponse(error);
|
|
}
|
|
}
|