Skip to content

Commit

Permalink
fixed issue where roles were getting pushed to memory more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
FirePlank committed Dec 1, 2023
1 parent 3d380fb commit 4d6e3a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bot/extensions/selectable_roles/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def __init__(self, bot: core.DiscordBot):

def update_roles(self, guild_id: int, data: tuple[str, int]) -> None:
if self.roles.get(guild_id):
for role in self.roles[guild_id]:
if role.id == data[1]:
return
self.roles[guild_id].append(Role(name=data[0], id=data[1]))
else:
self.roles[guild_id] = [Role(name=data[0], id=data[1])]
Expand Down

0 comments on commit 4d6e3a3

Please sign in to comment.