diff --git a/components.go b/components.go index 1f4ba58..4537bb2 100644 --- a/components.go +++ b/components.go @@ -201,14 +201,14 @@ func (m SelectMenu) MarshalJSON() ([]byte, error) { // TextInput represents text input component. type TextInput struct { - CustomID string `json:"custom_id"` - Label string `json:"label"` + CustomID string `json:"custom_id"` + Label string `json:"label"` Style TextInputStyle `json:"style"` - Placeholder string `json:"placeholder,omitempty"` - Value string `json:"value,omitempty"` - Required bool `json:"required,omitempty"` - MinLength int `json:"min_length,omitempty"` - MaxLength int `json:"max_length,omitempty"` + Placeholder string `json:"placeholder,omitempty"` + Value string `json:"value,omitempty"` + Required bool `json:"required,omitempty"` + MinLength int `json:"min_length,omitempty"` + MaxLength int `json:"max_length,omitempty"` } // Type is a method to get the type of a component. @@ -229,11 +229,11 @@ func (m TextInput) MarshalJSON() ([]byte, error) { }) } -// TextInputStyleType is style of text in TextInput component. -type TextInputStyleType uint +// TextInputStyle is style of text in TextInput component. +type TextInputStyle uint // Text styles const ( - TextInputShort TextStyleType = 1 - TextInputParagraph TextStyleType = 2 + TextInputShort TextInputStyle = 1 + TextInputParagraph TextInputStyle = 2 ) diff --git a/examples/modals/main.go b/examples/modals/main.go index 90e9887..effd8f1 100644 --- a/examples/modals/main.go +++ b/examples/modals/main.go @@ -54,7 +54,7 @@ var ( discordgo.TextInput{ CustomID: "opinion", Label: "What is your opinion on them?", - Style: discordgo.TextStyleShort, + Style: discordgo.TextInputShort, Placeholder: "Don't be shy, share your opinion with us", Required: true, MaxLength: 300, @@ -67,7 +67,7 @@ var ( discordgo.TextInput{ CustomID: "suggestions", Label: "What would you suggest to improve them?", - Style: discordgo.TextStyleParagraph, + Style: discordgo.TextInputParagraph, Required: false, MaxLength: 2000, },