Skip to content
Snippets Groups Projects
Commit 8e28a347 authored by dnns01's avatar dnns01
Browse files

fix: $122 - added greeting message, that is sent as soon as somebody is...

fix: $122 - added greeting message, that is sent as soon as somebody is assigned the "Studentin" role
parent 21c9d039
No related branches found
No related tags found
No related merge requests found
......@@ -196,3 +196,17 @@ class RolesCog(commands.Cog):
await utils.send_dm(member, f"Rolle \"{role.name}\" erfolgreich hinzugefügt")
if student_role and not role == student_role:
await member.add_roles(student_role)
@commands.Cog.listener()
async def on_member_update(self, before, after):
if len(before.roles) != len(after.roles):
roles_before = before.roles
roles_after = after.roles
for role in roles_before:
if role in roles_after:
roles_after.remove(role)
if len(roles_after) > 0:
if roles_after[0].id == int(os.getenv("DISCORD_STUDENTIN_ROLE")):
channel = await self.bot.fetch_channel(int(os.getenv("DISCORD_GREETING_CHANNEL")))
await channel.send(f"Herzlich Willkommen <@!{before.id}> im Kreise der Studentinnen :wave:")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment