Add moderator bots and editable MineGeo usernames
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 3m27s

This commit is contained in:
2026-10-29 16:32:55 +05:00
parent 658c8974ac
commit 50b27cf498
19 changed files with 654 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ export const displayNameSchema = z
(value) => !/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/u.test(value),
"Use a single line without hidden control characters",
);
export const usernameSchema = z.string().trim().toLowerCase().regex(/^[a-z0-9_]{3,32}$/, "Use 3–32 letters, numbers or underscores.");
export const newPasswordSchema = z
.string()
.min(12, "Use at least 12 characters")
@@ -41,6 +42,7 @@ export const authActionSchema = z.discriminatedUnion("action", [
export const profileUpdateSchema = z
.object({
displayName: displayNameSchema.optional(),
username: usernameSchema.optional(),
glowColor: glowColorSchema.optional(),
avatarPath: z.string().max(128).nullable().optional(),
})
@@ -48,6 +50,7 @@ export const profileUpdateSchema = z
.refine(
(value) =>
value.displayName !== undefined ||
value.username !== undefined ||
value.glowColor !== undefined ||
value.avatarPath !== undefined,
"Choose a profile change",
@@ -81,5 +84,6 @@ export function authDestination(value: string | null | undefined): string {
if (value && /^\/support\/[0-9a-f-]{36}$/i.test(value)) return value;
if (value && /^\/tournaments\?map=[0-9a-f-]{36}$/i.test(value)) return value;
if (value && /^\/pair\?code=[A-F0-9]{8}$/.test(value)) return value;
if (value && /^\/moderator-application\/[a-f0-9]{64}$/.test(value)) return value;
return "/dashboard";
}

View File

@@ -642,6 +642,7 @@ export type Database = {
};
profiles: {
Row: AccountStatusFields & {
username: string | null;
avatar_path: string | null;
glow_color: string;
bug_finder: boolean;
@@ -654,6 +655,7 @@ export type Database = {
role: string;
};
Insert: Partial<AccountStatusFields> & {
username?: string | null;
avatar_path?: string | null;
glow_color?: string;
bug_finder?: boolean;
@@ -666,6 +668,7 @@ export type Database = {
role?: string;
};
Update: Partial<AccountStatusFields> & {
username?: string | null;
avatar_path?: string | null;
glow_color?: string;
bug_finder?: boolean;

View File

@@ -1103,5 +1103,12 @@
"Unban": "Разблокировать",
"Chat slow mode: wait before sending another message": "Медленный режим чата: подождите перед отправкой следующего сообщения",
"You are banned from this tournament": "Вы заблокированы в этом турнире",
"You are banned from this party": "Вы заблокированы в этой группе"
"You are banned from this party": "Вы заблокированы в этой группе",
"MineGeo username": "Имя пользователя MineGeo",
"Your unique username for applications. You can change it anytime.": "Ваше уникальное имя для заявок. Его можно изменить в любой момент.",
"Username": "Имя пользователя",
"3–32 letters, numbers or underscores.": "3–32 латинские буквы, цифры или символы подчёркивания.",
"Save username": "Сохранить имя пользователя",
"Username saved.": "Имя пользователя сохранено.",
"That username is already taken.": "Это имя пользователя уже занято."
}