Skip to content

Commit

Permalink
ignore member update when role was already set
Browse files Browse the repository at this point in the history
  • Loading branch information
odrling committed Dec 20, 2024
1 parent 57df0d7 commit bd235a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nanachan/extensions/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ async def on_member_update(self, before: Member, after: Member):
if len(year_role) != 1:
return
year_role = year_role[0]

if year_role == YEAR_ROLES[0]: # 4A+
return

# skip if role was already there
for role in before.roles:
if year_role == role.id:
return

current_date = datetime.now()
graduation_year_offset = 1 if current_date.month >= 9 else 0
graduation_year = (
Expand Down

0 comments on commit bd235a3

Please sign in to comment.