You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

03-buttons-in-depth.md 1.5 KiB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Buttons in depth
  2. There are many changes you can make to buttons, lets take a look at the parameters in the `WithButton` function"
  3. | Name | Type | Description |
  4. |----------|---------------|----------------------------------------------------------------|
  5. | label | `string` | The label text for the button. |
  6. | customId | `string` | The custom id of the button. |
  7. | style | `ButtonStyle` | The style of the button. |
  8. | emote | `IEmote` | A IEmote to be used with this button. |
  9. | url | `string` | A URL to be used only if the `ButtonStyle` is a Link. |
  10. | disabled | `bool` | Whether or not the button is disabled. |
  11. | row | `int` | The row to place the button if it has enough room, otherwise 0 |
  12. ### Label
  13. This is the front facing text that the user sees. The maximum length is 80 characters.
  14. ### CustomId
  15. This is the property sent to you by discord when a button is clicked. It is not required for link buttons as they do not emit an event. The maximum length is 100 characters.
  16. ### Style
  17. Styling your buttons are important for indicating different actions:
  18. ![](Images/image3.png)
  19. You can do this by using the `ButtonStyle` which has all the styles defined.
  20. ### Emote
  21. You can specify an `IEmote` when creating buttons to add them to your button. They have the same restrictions as putting guild based emotes in messages.
  22. ### Url
  23. If you use the link style with your button you can specify a url. When this button is clicked the user is taken to that url.
  24. ### Disabled
  25. You can specify if your button is disabled, meaning users won't be able to click on it.