mirror of https://github.com/velour/catbase.git
roles: make toggle case insensitive
This commit is contained in:
parent
09cc6f75c3
commit
ad3b264a89
|
@ -78,7 +78,7 @@ func (p *RolesPlugin) toggleRole(r bot.Request) bool {
|
|||
return true
|
||||
}
|
||||
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 {
|
||||
log.Error().Err(err).Msg("setRole")
|
||||
p.b.Send(r.Conn, bot.Message, r.Msg.Channel, "I couldn't set that role.")
|
||||
|
|
Loading…
Reference in New Issue