mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-09-29 13:48:53 +00:00
discord: Fix style issues (#272)
* Discord: Fix comment style issues * Discord: use URL type alias for URls instead of string
This commit is contained in:
parent
f334491dee
commit
2647267460
|
@ -72,7 +72,7 @@ type Component interface {
|
|||
Type() ComponentType
|
||||
}
|
||||
|
||||
// ActionRow is a row of components at the bottom of a message.
|
||||
// ActionRowComponent is a row of components at the bottom of a message.
|
||||
type ActionRowComponent struct {
|
||||
Components []Component `json:"components"`
|
||||
}
|
||||
|
@ -135,16 +135,17 @@ func (a *ActionRowComponent) UnmarshalJSON(b []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Button is a clickable button that may be added to an interaction response.
|
||||
// ButtonComponent is a clickable button that may be added to an interaction
|
||||
// response.
|
||||
type ButtonComponent struct {
|
||||
Label string `json:"label"`
|
||||
// CustomID attached to InteractionCreate event when clicked.
|
||||
CustomID string `json:"custom_id"`
|
||||
Style ButtonStyle `json:"style"`
|
||||
Emoji *ButtonEmoji `json:"emoji,omitempty"`
|
||||
// Present on link-style buttons.
|
||||
URL string `json:"url,omitempty"`
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
// URL is only present on link-style buttons.
|
||||
URL URL `json:"url,omitempty"`
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
}
|
||||
|
||||
// Type implements the Component interface.
|
||||
|
@ -157,11 +158,16 @@ type ButtonStyle uint
|
|||
|
||||
// All types of ButtonStyle documented.
|
||||
const (
|
||||
PrimaryButton ButtonStyle = iota + 1 // Blurple button.
|
||||
SecondaryButton // Grey button.
|
||||
SuccessButton // Green button.
|
||||
DangerButton // Red button.
|
||||
LinkButton // Button that navigates to a URL.
|
||||
// PrimaryButton is a blurple button.
|
||||
PrimaryButton ButtonStyle = iota + 1
|
||||
// SecondaryButton is a grey button.
|
||||
SecondaryButton
|
||||
// SuccessButton is a green button.
|
||||
SuccessButton
|
||||
// DangerButton is a red button.
|
||||
DangerButton
|
||||
// LinkButton is a button that navigates to a URL.
|
||||
LinkButton
|
||||
)
|
||||
|
||||
// ButtonEmoji is the emoji displayed on the button before the text.
|
||||
|
@ -188,7 +194,8 @@ func (b ButtonComponent) MarshalJSON() ([]byte, error) {
|
|||
})
|
||||
}
|
||||
|
||||
// Select is a clickable button that may be added to an interaction response.
|
||||
// SelectComponent is a clickable button that may be added to an interaction
|
||||
// response.
|
||||
type SelectComponent struct {
|
||||
CustomID string `json:"custom_id"`
|
||||
Options []SelectComponentOption `json:"options"`
|
||||
|
|
Loading…
Reference in a new issue