Skip to content

Commit 457a90d

Browse files
committed
Misc
* update build.yml to look for go v1.18 * add 2 missing struct fields in application_commands.go * update .gitignore
1 parent 1aa34c4 commit 457a90d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v2
1616
with:
17-
go-version: 1.17
17+
go-version: 1.18
1818

1919
- name: Vet
2020
run: go vet ./...

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/.idea/
2+
3+
*.exe

api/application_commands.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ type ApplicationCommand struct {
3737
Description string `json:"description"` // 1-100 character description for CHAT_INPUT command, empty string for USER and MESSAGE command
3838
DescriptionLocalizations LocalizationDict `json:"description_localizations,omitempty"` // Localization dictionary for the description field. Values follow the same restrictions as description
3939
Options []ApplicationCommandOption `json:"options,omitempty"` // the parameters for the command, max 25; CHAT_INPUT
40-
DefaultPermissions bool `json:"default_permissions,omitempty"` // default true; whether the command is enabled by default when added to a guild
40+
DefaultMemberPermission *string `json:"default_member_permission"` // Set of permissions represented as a bit set
41+
DmPermission bool `json:"dm_permission,omitempty"` // Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible.
4142
Version Snowflake `json:"version"` // autoincrementing version identifier updated during substantial record changes
4243
}
4344

@@ -64,7 +65,9 @@ type ApplicationCommandOption struct {
6465
ChannelTypes []ChannelType `json:"channel_types,omitempty"` // if the option is a channel type, the channels shown will be restricted to these types
6566
MinValue interface{} `json:"min_value,omitempty"` // if the option is an INTEGER or NUMBER type, the minimum value permitted; integer for INTEGER options, double for NUMBER options
6667
MaxValue interface{} `json:"max_value,omitempty"` // if the option is an INTEGER or NUMBER type, the maximum value permitted; integer for INTEGER options, double for NUMBER options
67-
Autocomplete bool `json:"autocomplete,omitempty"` // enable autocomplete interactions for this option
68+
MinLength int `json:"min_length,omitempty"` // For option type STRING, the minimum allowed length (minimum of 0, maximum of 6000)
69+
MaxLength int `json:"max_length,omitempty"` // For option type STRING, the maximum allowed length (minimum of 1, maximum of 6000)
70+
Autocomplete bool `json:"autocomplete,omitempty"` // If autocomplete interactions are enabled for this STRING, INTEGER, or NUMBER type option
6871
}
6972

7073
// ApplicationCommandOptionType - The option type of the command
@@ -123,8 +126,9 @@ type ApplicationCommandPermissionType int
123126

124127
//goland:noinspection GoUnusedConst
125128
const (
126-
PermissionTypeRole ApplicationCommandPermissionType = iota + 1 // ROLE
127-
PermissionTypeUser // USER
129+
PermissionTypeRole ApplicationCommandPermissionType = iota + 1 // ROLE
130+
PermissionTypeUser // USER
131+
PermissionTypeChannel // CHANNEL
128132
)
129133

130134
// GetGlobalApplicationCommands - Fetch all the global commands for your application.

0 commit comments

Comments
 (0)