Skip to content

Commit

Permalink
server(bot): auth conditional return exits
Browse files Browse the repository at this point in the history
  • Loading branch information
rumblefrog committed Nov 21, 2019
1 parent fcecd28 commit 24d2511
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/bot/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ func Auth(fn exrouter.HandlerFunc) exrouter.HandlerFunc {
if err != nil {
logrus.WithField("error", err).Warn()
ctx.Reply("Could not fetch guild: ", err)
return
}

member, err := ctx.Member(guild.ID, ctx.Msg.Author.ID)

if err != nil {
ctx.Reply("Could not fetch member: ", err)
return
}

if GuildMemberPermissions(member, guild)&discordgo.PermissionManageServer != 0 {
Expand Down

0 comments on commit 24d2511

Please sign in to comment.