fix(config): a role can be present twice
This commit is contained in:
parent
bde93e6b80
commit
fc151a9cee
2 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue