roles: make toggle case insensitive

This commit is contained in:
Chris Sexton 2022-07-28 17:42:34 -04:00
parent 09cc6f75c3
commit ad3b264a89
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ func (p *RolesPlugin) toggleRole(r bot.Request) bool {
return true return true
} }
for _, rr := range roles { for _, rr := range roles {
if rr.Name == role { if strings.ToLower(rr.Name) == strings.ToLower(role) {
if err = r.Conn.SetRole(r.Msg.User.ID, rr.ID); err != nil { if err = r.Conn.SetRole(r.Msg.User.ID, rr.ID); err != nil {
log.Error().Err(err).Msg("setRole") log.Error().Err(err).Msg("setRole")
p.b.Send(r.Conn, bot.Message, r.Msg.Channel, "I couldn't set that role.") p.b.Send(r.Conn, bot.Message, r.Msg.Channel, "I couldn't set that role.")