Skip to content

Commit 041a4ad

Browse files
author
Jake Gealer
committed
bump to master branches
1 parent 004d378 commit 041a4ad

12 files changed

+396
-229
lines changed

command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (c *Command) mapOptions(autocomplete bool, data *objects.ApplicationCommand
118118
id: v.Value.(string),
119119
data: data,
120120
}
121-
case objects.TypeDouble:
121+
case objects.TypeNumber:
122122
mappedOptions[option.Name] = v.Value
123123
}
124124
}

command__test.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func Test_findOption(t *testing.T) {
2020
options []*objects.ApplicationCommandOption
2121

2222
wants *objects.ApplicationCommandOption
23-
}{
23+
}{
2424
{
2525
name: "nil slice",
2626
},
@@ -78,37 +78,37 @@ func TestCommand_mapOptions(t *testing.T) {
7878
}{
7979
{
8080
name: "option not in command",
81-
cmdOptions: []*objects.ApplicationCommandOption{
81+
cmdOptions: []*objects.ApplicationCommandOption{
8282
{
8383
OptionType: objects.TypeInteger,
84-
Name: "opt1",
84+
Name: "opt1",
8585
},
8686
{
8787
OptionType: objects.TypeString,
88-
Name: "opt2",
88+
Name: "opt2",
8989
},
9090
},
9191
retOptions: []*objects.ApplicationCommandInteractionDataOption{
9292
{
93-
Type: objects.TypeString,
93+
Type: objects.TypeString,
9494
Name: "opt3",
9595
Value: "123",
9696
},
9797
},
9898
expectsErr: "interaction option doesn't exist on command",
9999
},
100100
{
101-
name: "autocomplete type mismatch",
101+
name: "autocomplete type mismatch",
102102
autocomplete: true,
103-
cmdOptions: []*objects.ApplicationCommandOption{
103+
cmdOptions: []*objects.ApplicationCommandOption{
104104
{
105105
OptionType: objects.TypeInteger,
106-
Name: "opt1",
106+
Name: "opt1",
107107
},
108108
},
109109
retOptions: []*objects.ApplicationCommandInteractionDataOption{
110110
{
111-
Type: objects.TypeString,
111+
Type: objects.TypeString,
112112
Name: "opt1",
113113
Value: "123",
114114
},
@@ -118,25 +118,25 @@ func TestCommand_mapOptions(t *testing.T) {
118118
},
119119
},
120120
{
121-
name: "non-autocomplete type mismatch",
121+
name: "non-autocomplete type mismatch",
122122
cmdOptions: []*objects.ApplicationCommandOption{
123123
{
124124
OptionType: objects.TypeInteger,
125-
Name: "opt1",
125+
Name: "opt1",
126126
},
127127
},
128128
retOptions: []*objects.ApplicationCommandInteractionDataOption{
129129
{
130-
Type: objects.TypeString,
130+
Type: objects.TypeString,
131131
Name: "opt1",
132132
Value: "123",
133133
},
134134
},
135135
expectsErr: "mismatched interaction option",
136136
},
137137
{
138-
name: "channel option",
139-
data: &objects.ApplicationCommandInteractionData{ID: 6921},
138+
name: "channel option",
139+
data: &objects.ApplicationCommandInteractionData{ID: 6921},
140140
cmdOptions: []*objects.ApplicationCommandOption{
141141
{
142142
OptionType: objects.TypeChannel,
@@ -158,8 +158,8 @@ func TestCommand_mapOptions(t *testing.T) {
158158
},
159159
},
160160
{
161-
name: "role option",
162-
data: &objects.ApplicationCommandInteractionData{ID: 6921},
161+
name: "role option",
162+
data: &objects.ApplicationCommandInteractionData{ID: 6921},
163163
cmdOptions: []*objects.ApplicationCommandOption{
164164
{
165165
OptionType: objects.TypeRole,
@@ -181,8 +181,8 @@ func TestCommand_mapOptions(t *testing.T) {
181181
},
182182
},
183183
{
184-
name: "user option",
185-
data: &objects.ApplicationCommandInteractionData{ID: 6921},
184+
name: "user option",
185+
data: &objects.ApplicationCommandInteractionData{ID: 6921},
186186
cmdOptions: []*objects.ApplicationCommandOption{
187187
{
188188
OptionType: objects.TypeUser,
@@ -204,7 +204,7 @@ func TestCommand_mapOptions(t *testing.T) {
204204
},
205205
},
206206
{
207-
name: "string option",
207+
name: "string option",
208208
cmdOptions: []*objects.ApplicationCommandOption{
209209
{
210210
OptionType: objects.TypeString,
@@ -223,7 +223,7 @@ func TestCommand_mapOptions(t *testing.T) {
223223
},
224224
},
225225
{
226-
name: "int option",
226+
name: "int option",
227227
cmdOptions: []*objects.ApplicationCommandOption{
228228
{
229229
OptionType: objects.TypeInteger,
@@ -242,7 +242,7 @@ func TestCommand_mapOptions(t *testing.T) {
242242
},
243243
},
244244
{
245-
name: "boolean option",
245+
name: "boolean option",
246246
cmdOptions: []*objects.ApplicationCommandOption{
247247
{
248248
OptionType: objects.TypeBoolean,
@@ -261,8 +261,8 @@ func TestCommand_mapOptions(t *testing.T) {
261261
},
262262
},
263263
{
264-
name: "mentionable option",
265-
data: &objects.ApplicationCommandInteractionData{ID: 6921},
264+
name: "mentionable option",
265+
data: &objects.ApplicationCommandInteractionData{ID: 6921},
266266
cmdOptions: []*objects.ApplicationCommandOption{
267267
{
268268
OptionType: objects.TypeMentionable,
@@ -284,16 +284,16 @@ func TestCommand_mapOptions(t *testing.T) {
284284
},
285285
},
286286
{
287-
name: "double option",
287+
name: "double option",
288288
cmdOptions: []*objects.ApplicationCommandOption{
289289
{
290-
OptionType: objects.TypeDouble,
290+
OptionType: objects.TypeNumber,
291291
Name: "opt1",
292292
},
293293
},
294294
retOptions: []*objects.ApplicationCommandInteractionDataOption{
295295
{
296-
Type: objects.TypeDouble,
296+
Type: objects.TypeNumber,
297297
Name: "opt1",
298298
Value: (float64)(69),
299299
},

command_builder_gen.go

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

command_builder_impl_options.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,32 @@ type DoubleChoice struct {
2929
Value float64 `json:"value"`
3030
}
3131

32-
func (c *commandBuilder) appendOption(type_ objects.ApplicationCommandOptionType, name, description string, required, default_ bool) CommandBuilder {
32+
func (c *commandBuilder) appendOption(type_ objects.ApplicationCommandOptionType, name, description string, required bool) CommandBuilder {
3333
c.cmd.Options = append(c.cmd.Options, &objects.ApplicationCommandOption{
3434
OptionType: type_,
3535
Name: name,
3636
Description: description,
3737
Required: required,
38-
Default: default_,
3938
})
4039
return c
4140
}
4241

43-
func (c *commandBuilder) BoolOption(name, description string, required, default_ bool) CommandBuilder {
44-
return c.appendOption(objects.TypeBoolean, name, description, required, default_)
42+
func (c *commandBuilder) BoolOption(name, description string, required bool) CommandBuilder {
43+
return c.appendOption(objects.TypeBoolean, name, description, required)
4544
}
4645

4746
func (c *commandBuilder) UserOption(name, description string, required bool) CommandBuilder {
48-
return c.appendOption(objects.TypeUser, name, description, required, false)
47+
return c.appendOption(objects.TypeUser, name, description, required)
4948
}
5049

5150
func (c *commandBuilder) ChannelOption(name, description string, required bool) CommandBuilder {
52-
return c.appendOption(objects.TypeChannel, name, description, required, false)
51+
return c.appendOption(objects.TypeChannel, name, description, required)
5352
}
5453

5554
func (c *commandBuilder) RoleOption(name, description string, required bool) CommandBuilder {
56-
return c.appendOption(objects.TypeRole, name, description, required, false)
55+
return c.appendOption(objects.TypeRole, name, description, required)
5756
}
5857

5958
func (c *commandBuilder) MentionableOption(name, description string, required bool) CommandBuilder {
60-
return c.appendOption(objects.TypeMentionable, name, description, required, false)
59+
return c.appendOption(objects.TypeMentionable, name, description, required)
6160
}

0 commit comments

Comments
 (0)