Refactor self-role management to use a role builder interface

- Replaced the text area for role input with a structured role builder, enhancing user experience and reducing input errors.
- Updated the self-role management logic to handle roles as structured objects instead of plain text, improving data integrity.
- Introduced new functions for parsing and validating roles, ensuring compliance with the new builder format.
- Enhanced error handling for role creation and updates, providing clearer feedback for missing or invalid data.
- Updated localization files to reflect changes in role management terminology and instructions.
This commit is contained in:
TheOnlyMace
2026-07-25 15:53:27 +02:00
parent ba2d144038
commit 67ac16d36b
10 changed files with 955 additions and 192 deletions

View File

@@ -845,6 +845,14 @@ export const DiscordRoleOptionSchema = z.object({
});
export type DiscordRoleOption = z.infer<typeof DiscordRoleOptionSchema>;
export const DiscordEmojiOptionSchema = z.object({
id: SnowflakeSchema,
name: z.string(),
animated: z.boolean(),
url: z.string().url()
});
export type DiscordEmojiOption = z.infer<typeof DiscordEmojiOptionSchema>;
/**
* Known slash command names, aggregated from every module's
* `command-definitions.ts` (`SlashCommandBuilder#setName`). Used by the