Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
the linter caught shadowed variables that were preventing errors from being returned properly
  • Loading branch information
Dan Brakeley committed Nov 19, 2021
1 parent 007bf76 commit eaf6bca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions restapi.go
Expand Up @@ -2536,7 +2536,7 @@ func (s *Session) ApplicationCommands(appID, guildID string) (cmd []*Application
// appID : The application ID.
// interaction : Interaction instance.
// resp : Response message data.
func (s *Session) InteractionRespond(interaction *Interaction, resp *InteractionResponse) (err error) {
func (s *Session) InteractionRespond(interaction *Interaction, resp *InteractionResponse) error {
endpoint := EndpointInteractionResponse(interaction.ID, interaction.Token)

if resp.Data != nil && len(resp.Data.Files) > 0 {
Expand All @@ -2546,9 +2546,10 @@ func (s *Session) InteractionRespond(interaction *Interaction, resp *Interaction
}

_, err = s.request("POST", endpoint, contentType, body, endpoint, 0)
} else {
_, err = s.RequestWithBucketID("POST", endpoint, *resp, endpoint)
return err
}

_, err := s.RequestWithBucketID("POST", endpoint, *resp, endpoint)
return err
}

Expand Down
6 changes: 4 additions & 2 deletions state.go
Expand Up @@ -845,8 +845,9 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {

err = s.GuildRemove(t.Guild)
case *GuildMemberAdd:
var guild *Guild
// Updates the MemberCount of the guild.
guild, err := s.Guild(t.Member.GuildID)
guild, err = s.Guild(t.Member.GuildID)
if err != nil {
return err
}
Expand All @@ -861,8 +862,9 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {
err = s.MemberAdd(t.Member)
}
case *GuildMemberRemove:
var guild *Guild
// Updates the MemberCount of the guild.
guild, err := s.Guild(t.Member.GuildID)
guild, err = s.Guild(t.Member.GuildID)
if err != nil {
return err
}
Expand Down

0 comments on commit eaf6bca

Please sign in to comment.