The default_settings object provides factory functions to quickly generate valid mock component structures for testing or previewing. These functions return ActionRowComponent or specific component types with randomized or placeholder data (like random animal names or sentences).
Available factories:
Button(): Returns an ActionRowComponent containing a standard button.LinkButton(): Returns an ActionRowComponent containing a button with ButtonStyle.URL.StringSelect(): Returns an ActionRowComponent containing a StringSelectComponent.TextDisplay(): Returns a TextDisplayComponent with random text.Thumbnail: A static object for a thumbnail component.MediaGallery: A static object for a media gallery.File: A static object for a file component.Separator: A static object for a separator.Container: A static object for a container.
Example of generating a mock button row:
const mockButtonRow = default_settings.Button();
export const default_settings = {
Button: () => ({
type: 1,
components: [{
..._Button,
custom_id: uuidv4(),
label: generateRandomAnimal()
}]
}),
// ... other factories
} as {
Button: () => ActionRowComponent<ButtonComponent>,
// ...
}