fix(config): a role can be present twice

This commit is contained in:
Anhgelus Morhtuuzh 2024-04-15 16:17:31 +02:00
parent bde93e6b80
commit fc151a9cee
No known key found for this signature in database
GPG key ID: CF4550297832A29F
2 changed files with 13 additions and 4 deletions

View file

@ -32,9 +32,9 @@ func (cfg *GuildConfig) Save() {
gokord.DB.Save(cfg)
}
func (cfg *GuildConfig) FindXpRole(xp uint, roleID string) (int, *XpRole) {
func (cfg *GuildConfig) FindXpRole(roleID string) (int, *XpRole) {
for i, r := range cfg.XpRoles {
if r.XP == xp && r.RoleID == roleID {
if r.RoleID == roleID {
return i, &r
}
}