Merge pull request #683 from recapitalverb/develop

Remove State fallback from Session#Guild
This commit is contained in:
Carson Hoffman 2019-12-26 19:46:40 -05:00 committed by GitHub
commit e4e03cf8b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -583,14 +583,6 @@ func memberPermissions(guild *Guild, channel *Channel, member *Member) (apermiss
// Guild returns a Guild structure of a specific Guild. // Guild returns a Guild structure of a specific Guild.
// guildID : The ID of a Guild // guildID : The ID of a Guild
func (s *Session) Guild(guildID string) (st *Guild, err error) { func (s *Session) Guild(guildID string) (st *Guild, err error) {
if s.StateEnabled {
// Attempt to grab the guild from State first.
st, err = s.State.Guild(guildID)
if err == nil && !st.Unavailable {
return
}
}
body, err := s.RequestWithBucketID("GET", EndpointGuild(guildID), nil, EndpointGuild(guildID)) body, err := s.RequestWithBucketID("GET", EndpointGuild(guildID), nil, EndpointGuild(guildID))
if err != nil { if err != nil {
return return