Skip to content

Commit

Permalink
Add an extra condition
Browse files Browse the repository at this point in the history
  • Loading branch information
SlimShadyIAm committed Oct 13, 2024
1 parent 65247be commit 9763380
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cogs/monitors/utils/xp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import discord
from discord.ext import commands

Expand Down Expand Up @@ -58,8 +59,10 @@ async def on_message(self, message):
def assess_new_roles(self, new_level, member: discord.Member):
roles_to_add = []
if 15 > new_level and cfg.roles.new_member is not None:
roles_to_add.append(cfg.roles.new_member)
self.bot.tasks.schedule_remove_new_member_role(member.id)
member_joined_less_than_a_day_ago = datetime.datetime.now() - member.created_at < datetime.timedelta(days=1)
if member_joined_less_than_a_day_ago:
roles_to_add.append(cfg.roles.new_member)
self.bot.tasks.schedule_remove_new_member_role(member.id)
if 15 <= new_level:
roles_to_add.append(cfg.roles.member_plus)
if 30 <= new_level:
Expand Down

0 comments on commit 9763380

Please sign in to comment.