fix error shadowing in InteractionRespond (#1030)
This commit is contained in:
parent
4d72c306b4
commit
2b359776da
2 changed files with 8 additions and 5 deletions
|
@ -2806,7 +2806,7 @@ func (s *Session) ApplicationCommandPermissionsBatchEdit(appID, guildID string,
|
|||
// InteractionRespond creates the response to an interaction.
|
||||
// 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 {
|
||||
|
@ -2816,9 +2816,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
|
||||
}
|
||||
|
||||
|
|
6
state.go
6
state.go
|
@ -979,8 +979,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
|
||||
}
|
||||
|
@ -995,8 +996,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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue