Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement components #181

Closed
LeadcodeDev opened this issue Aug 2, 2024 · 0 comments · Fixed by #182
Closed

Implement components #181

LeadcodeDev opened this issue Aug 2, 2024 · 0 comments · Fixed by #182
Assignees
Labels
enhancement New feature or request

Comments

@LeadcodeDev
Copy link
Member

Context

Components are an important part of the user experience on the Discord platform, simplifying potential interactions that lead to actions defined by the developer.

Proposal

Buttons

Basic button

final button = Button(...namedParameters);

final button = Button.primary(...namedParameters);
final button = Button.secondary(...namedParameters);
final button = Button.danger(...namedParameters);
final button = Button.success(...namedParameters);
final button = Button.url(...namedParameters);

Menus

final selectMenu = SelectMenuBuilder.text(String customId)
  ..setPlaceholder(String str)
  ..setConstraint({ int? min, int? max, bool disabled = false })
  ..addOption(
    emoji: Emoji,
    label: string,
    value: string,
    description: string,
    default: boolean
  );

final selectMenu = SelectMenuBuilder.channel(String customId)
  ..setPlaceholder(String str)
  ..setConstraint({ int? min, int? max, bool disabled = false })
  ..setChannelTypes(List<ChannelType>)
  ..setDefaultValues(List<int> values);

final selectMenu = SelectMenuBuilder.user(String customId)
  ..setPlaceholder(String str)
  ..setConstraint({ int? min, int? max, bool disabled = false })
  ..setDefaultValues(List<int> values);

final selectMenu = SelectMenuBuilder.role(String customId)
  ..setPlaceholder(String str)
  ..setConstraint({ int? min, int? max, bool disabled = false })
  ..setDefaultValues(List<int> values);

final selectMenu = SelectMenuBuilder.mentionable(String customId)
  ..setPlaceholder(String str)
  ..setConstraint({ int? min, int? max, bool disabled = false })
  ..setDefaultValues(List<int> values);

Modal

final dialog = DialogBuilder(String customId)
  ..setTitle(String value)
  ..addTextInput((input) {
    input
      ..setLabel(String value)
      ..setConstraint({ int? min, int? max, bool required = false })
      ..setDefaultValue(String, value)
      ..setPlaceholder(String value)
  });
@LeadcodeDev LeadcodeDev self-assigned this Aug 2, 2024
@LeadcodeDev LeadcodeDev added the enhancement New feature or request label Aug 2, 2024
@LeadcodeDev LeadcodeDev linked a pull request Aug 3, 2024 that will close this issue
@LeadcodeDev LeadcodeDev closed this as completed by moving to Done in Roadmap Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
1 participant