From 069da9f1c65de76181bb79e7b0a2e18ab18eb0c0 Mon Sep 17 00:00:00 2001 From: Luther Wen Xu Date: Sun, 31 May 2020 12:10:45 +0800 Subject: [PATCH] fix: Bot should not be given roles --- level/roles.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/level/roles.go b/level/roles.go index bb60157..9fab404 100644 --- a/level/roles.go +++ b/level/roles.go @@ -36,6 +36,9 @@ func AssignRoles(dg *discordgo.Session, guildID string, userID string, rank Rank if len(member.Roles) == 0 { return } + if member.User.Bot { + return + } OuterLoop: for i := 0; i <= int(rank); i++ { if i >= len(Roles) {