mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-10-01 06:48:51 +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
|
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 {
|
type ActionRowComponent struct {
|
||||||
Components []Component `json:"components"`
|
Components []Component `json:"components"`
|
||||||
}
|
}
|
||||||
|
@ -135,15 +135,16 @@ func (a *ActionRowComponent) UnmarshalJSON(b []byte) error {
|
||||||
return nil
|
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 {
|
type ButtonComponent struct {
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
// CustomID attached to InteractionCreate event when clicked.
|
// CustomID attached to InteractionCreate event when clicked.
|
||||||
CustomID string `json:"custom_id"`
|
CustomID string `json:"custom_id"`
|
||||||
Style ButtonStyle `json:"style"`
|
Style ButtonStyle `json:"style"`
|
||||||
Emoji *ButtonEmoji `json:"emoji,omitempty"`
|
Emoji *ButtonEmoji `json:"emoji,omitempty"`
|
||||||
// Present on link-style buttons.
|
// URL is only present on link-style buttons.
|
||||||
URL string `json:"url,omitempty"`
|
URL URL `json:"url,omitempty"`
|
||||||
Disabled bool `json:"disabled,omitempty"`
|
Disabled bool `json:"disabled,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,11 +158,16 @@ type ButtonStyle uint
|
||||||
|
|
||||||
// All types of ButtonStyle documented.
|
// All types of ButtonStyle documented.
|
||||||
const (
|
const (
|
||||||
PrimaryButton ButtonStyle = iota + 1 // Blurple button.
|
// PrimaryButton is a blurple button.
|
||||||
SecondaryButton // Grey button.
|
PrimaryButton ButtonStyle = iota + 1
|
||||||
SuccessButton // Green button.
|
// SecondaryButton is a grey button.
|
||||||
DangerButton // Red button.
|
SecondaryButton
|
||||||
LinkButton // Button that navigates to a URL.
|
// 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.
|
// 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 {
|
type SelectComponent struct {
|
||||||
CustomID string `json:"custom_id"`
|
CustomID string `json:"custom_id"`
|
||||||
Options []SelectComponentOption `json:"options"`
|
Options []SelectComponentOption `json:"options"`
|
||||||
|
|
Loading…
Reference in a new issue