Enhance welcome module with embed text rendering and autorole management
- Updated the welcome embed functionality to allow for user mentions in titles, authors, and footers, while maintaining clickable mentions in descriptions. - Implemented autorole assignment logic with checks for role manageability and hierarchy, including detailed logging for skipped roles. - Improved the WebUI to display real user and guild data in the welcome embed preview, enhancing user experience. - Refactored the welcome text rendering to support additional options for mention handling based on the context of the embed fields.
This commit is contained in:
@@ -27,6 +27,17 @@ describe('phase2 helpers', () => {
|
||||
expect(result).toBe('Join <#123456789012345678> please');
|
||||
});
|
||||
|
||||
it('maps embed text fields with field names', async () => {
|
||||
const { mapEmbedTextFields } = await import('./phase2.js');
|
||||
const mapped = mapEmbedTextFields(
|
||||
{ title: 'T:{user}', description: 'D:{user}', footerText: 'F:{user}' },
|
||||
(value, field) => `${field}:${value}`
|
||||
);
|
||||
expect(mapped.title).toBe('title:T:{user}');
|
||||
expect(mapped.description).toBe('description:D:{user}');
|
||||
expect(mapped.footerText).toBe('footerText:F:{user}');
|
||||
});
|
||||
|
||||
it('accepts extended embed fields', async () => {
|
||||
const { WelcomeEmbedSchema, embedHasContent } = await import('./phase2.js');
|
||||
const parsed = WelcomeEmbedSchema.parse({
|
||||
|
||||
Reference in New Issue
Block a user