Skip to content

Commit 6e549a0

Browse files
committed
MBG on top ong
1 parent 3e04822 commit 6e549a0

File tree

1 file changed

+18
-4
lines changed
  • frontend/src/app/api/upload-config

1 file changed

+18
-4
lines changed

frontend/src/app/api/upload-config/route.ts

+18-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const processingRequests = new Set<string>();
99
// Time limit: 24 hours in milliseconds
1010
const UPLOAD_COOLDOWN = 24 * 60 * 60 * 1000;
1111

12-
// Bad words list (will add more as needed)
12+
// Bad words list (expand as needed)
1313
const BAD_WORDS = [
1414
"nigger", "nigga", "fuck", "shit", "bitch", "asshole", "cunt", "faggot", "retard", "whore",
1515
"dick", "pussy", "bastard", "slut", "damn", "hell", "cock", "tits", "prick", "chink",
@@ -29,6 +29,20 @@ const BAD_WORDS = [
2929
"bint", "slag", "tart","weasel", "scumbag"
3030
].map(word => word.toLowerCase());
3131

32+
// Discord Embed interface
33+
interface DiscordEmbed {
34+
title: string;
35+
fields: { name: string; value: string; inline: boolean }[];
36+
color: number;
37+
timestamp: string;
38+
thumbnail?: { url: string };
39+
}
40+
41+
// GitHub PR interface (simplified)
42+
interface GitHubPR {
43+
title: string;
44+
}
45+
3246
// Helper to get unique user identifier
3347
function getUserIdentifier(request: NextRequest): string {
3448
const ip = request.headers.get('x-forwarded-for')?.split(',')[0].trim() || 'unknown-ip';
@@ -69,8 +83,8 @@ async function checkExistingPR(name: string, githubToken: string): Promise<boole
6983
console.error(`Failed to fetch PRs: ${await prsResponse.text()}`);
7084
return false;
7185
}
72-
const prs = await prsResponse.json();
73-
return prs.some((pr: any) => generateIdFromName(pr.title.replace('Add config: ', '')) === normalizedName);
86+
const prs: GitHubPR[] = await prsResponse.json();
87+
return prs.some(pr => generateIdFromName(pr.title.replace('Add config: ', '')) === normalizedName);
7488
}
7589

7690
// Helper to send Discord webhook notification
@@ -81,7 +95,7 @@ async function sendWebhookNotification(ip: string, configName: string, username:
8195
return;
8296
}
8397

84-
const embed: any = {
98+
const embed: DiscordEmbed = {
8599
title: 'New Config Uploaded',
86100
fields: [
87101
{ name: 'Config Name', value: configName, inline: true },

0 commit comments

Comments
 (0)