Merge pull request #681 from jyap808/patch-2

Modify GuildEdit bounds check
This commit is contained in:
bwmarrin 2019-08-26 15:53:21 -05:00 committed by GitHub
commit 5667d21687
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -617,10 +617,10 @@ func (s *Session) GuildCreate(name string) (st *Guild, err error) {
// g : A GuildParams struct with the values Name, Region and VerificationLevel defined.
func (s *Session) GuildEdit(guildID string, g GuildParams) (st *Guild, err error) {
// Bounds checking for VerificationLevel, interval: [0, 3]
// Bounds checking for VerificationLevel, interval: [0, 4]
if g.VerificationLevel != nil {
val := *g.VerificationLevel
if val < 0 || val > 3 {
if val < 0 || val > 4 {
err = ErrVerificationLevelBounds
return
}