-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext-input.go
50 lines (40 loc) · 953 Bytes
/
text-input.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package discog
import "github.com/bwmarrin/discordgo"
type TextInput struct {
textInput discordgo.TextInput
}
func NewTextInput(id string) *TextInput {
return &TextInput{
textInput: discordgo.TextInput{
CustomID: id,
},
}
}
func (t *TextInput) SetLabel(label string) *TextInput {
t.textInput.Label = label
return t
}
func (t *TextInput) SetPlaceholder(placeholder string) *TextInput {
t.textInput.Placeholder = placeholder
return t
}
func (t *TextInput) SetStyle(style discordgo.TextInputStyle) *TextInput {
t.textInput.Style = style
return t
}
func (t *TextInput) SetValue(value string) *TextInput {
t.textInput.Value = value
return t
}
func (t *TextInput) Required() *TextInput {
t.textInput.Required = true
return t
}
func (t *TextInput) SetMinMax(min int, max int) *TextInput {
t.textInput.MinLength = min
t.textInput.MaxLength = max
return t
}
func (t *TextInput) GetComponent() interface{} {
return t.textInput
}