Skip to content

Commit

Permalink
fix error when creating or updating global application command
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jun 5, 2024
1 parent fd872a1 commit 49119a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rest/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *applicationsImpl) GetGlobalCommands(applicationID snowflake.ID, withLoc

func (s *applicationsImpl) GetGlobalCommand(applicationID snowflake.ID, commandID snowflake.ID, opts ...RequestOpt) (command discord.ApplicationCommand, err error) {
var unmarshalCommand discord.UnmarshalApplicationCommand
err = s.client.Do(GetGlobalCommand.Compile(nil, applicationID, commandID), nil, &command, opts...)
err = s.client.Do(GetGlobalCommand.Compile(nil, applicationID, commandID), nil, &unmarshalCommand, opts...)
if err == nil {
command = unmarshalCommand.ApplicationCommand
}
Expand All @@ -79,7 +79,7 @@ func (s *applicationsImpl) GetGlobalCommand(applicationID snowflake.ID, commandI

func (s *applicationsImpl) CreateGlobalCommand(applicationID snowflake.ID, commandCreate discord.ApplicationCommandCreate, opts ...RequestOpt) (command discord.ApplicationCommand, err error) {
var unmarshalCommand discord.UnmarshalApplicationCommand
err = s.client.Do(CreateGlobalCommand.Compile(nil, applicationID), commandCreate, &command, opts...)
err = s.client.Do(CreateGlobalCommand.Compile(nil, applicationID), commandCreate, &unmarshalCommand, opts...)
if err == nil {
command = unmarshalCommand.ApplicationCommand
}
Expand Down

0 comments on commit 49119a6

Please sign in to comment.