forked from pothtonswer/discordmuffin
feat: add TextInputBuilder
This commit is contained in:
parent
83a8bfa438
commit
fd76911e9f
1 changed files with 53 additions and 0 deletions
53
builder.go
53
builder.go
|
@ -241,3 +241,56 @@ func (c *ComponentEmoji) SetAnimated(animated bool) *ComponentEmoji {
|
|||
c.Animated = animated
|
||||
return c
|
||||
}
|
||||
|
||||
// TextInputBuilder creates a new TextInput struct.
|
||||
func TextInputBuilder() *TextInput {
|
||||
return &TextInput{}
|
||||
}
|
||||
|
||||
// SetCustomID sets customID for TextInput.
|
||||
func (t *TextInput) SetCustomID(customID string) *TextInput {
|
||||
t.CustomID = customID
|
||||
return t
|
||||
}
|
||||
|
||||
// SetStyle sets style for TextInput.
|
||||
func (t *TextInput) SetStyle(style TextInputStyle) *TextInput {
|
||||
t.Style = style
|
||||
return t
|
||||
}
|
||||
|
||||
// SetLabel sets label for TextInput.
|
||||
func (t *TextInput) SetLabel(label string) *TextInput {
|
||||
t.Label = label
|
||||
return t
|
||||
}
|
||||
|
||||
// SetMinLength sets min length for TextInput.
|
||||
func (t *TextInput) SetMinLength(minLength int) *TextInput {
|
||||
t.MinLength = minLength
|
||||
return t
|
||||
}
|
||||
|
||||
// SetMaxLength sets max length for TextInput.
|
||||
func (t *TextInput) SetMaxLength(maxLength int) *TextInput {
|
||||
t.MaxLength = maxLength
|
||||
return t
|
||||
}
|
||||
|
||||
// SetRequired sets required for TextInput.
|
||||
func (t *TextInput) SetRequired(required bool) *TextInput {
|
||||
t.Required = required
|
||||
return t
|
||||
}
|
||||
|
||||
// SetValue sets value for TextInput.
|
||||
func (t *TextInput) SetValue(value string) *TextInput {
|
||||
t.Value = value
|
||||
return t
|
||||
}
|
||||
|
||||
// SetPlaceholder sets placeholder for TextInput.
|
||||
func (t *TextInput) SetPlaceholder(placeholder string) *TextInput {
|
||||
t.Placeholder = placeholder
|
||||
return t
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue