Skip to content

Commit

Permalink
Enable invite tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
rougeth committed Oct 14, 2021
1 parent f79329e commit 2b68c29
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pybr2021/cogs/greetings2.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def search_attendee(self, query):

@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
joined_with_invite_code = await self.invite_tracker.check_new_user(member)
if joined_with_invite_code:
return

role = await self.get_attendee_role(member.guild)
await member.add_roles(role)
await logchannel(self.bot, f"✅ atribuí cargo de participante para {member.mention} ")
Expand Down Expand Up @@ -238,13 +242,8 @@ async def on_message(self, message: discord.Message):
await logchannel(self.bot, f"✅\n{member.mention} confirmou sua inscrição")
logger.info(f"User authenticated. user={message.author.name}")

#@commands.Cog.listener()
@commands.Cog.listener()
async def on_ready(self):
channel = await self.bot.fetch_channel(self.AUTH_CHANNEL_ID)
await channel.purge()
message = await channel.send(auth_welcome.format(self.bot.user.mention))
await message.add_reaction(self.AUTH_START_EMOJI)

# Invite Tracker
guild = await self.get_guild()
self.invite_tracker = InviteTracker(self.bot, guild, ROLE_INVITE_MAP)
Expand Down

0 comments on commit 2b68c29

Please sign in to comment.