Advertisement
LawMixer

1

Nov 6th, 2022
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. @interactions.extension_listener
  2. async def on_guild_member_add(self, member: interactions.Member):
  3. now = datetime.datetime.now()
  4. client = self.client
  5.  
  6. memberGuildId = member.guild_id
  7.  
  8. subcribeDevelopment = await interactions.get(client, interactions.Role, object_id=890470382052712448, parent_id=self.serverId)
  9. subcribeEvents = await interactions.get(client, interactions.Role, object_id=890470398192402493, parent_id=self.serverId)
  10.  
  11.  
  12. # verification
  13. await verifHandler.updateInDepartmentGroup(self.client, ctx.author.id)
  14. await verifHandler.updateInMainGroup(self.client, ctx.author.id)
  15. await verifHandler.changeNickname(self.client, ctx.author)
  16.  
  17. # add there roles
  18. await member.add_role(subcribeDevelopment)
  19. await member.add_role(subcribeEvents)
  20.  
  21.  
  22. # welcome channel
  23. e = interactions.Channel(** await client._http.get_channel(self.finestChannel), _client=client._http)
  24. msg = await e.send(f"{member.mention} just joined the server.")
  25.  
  26. await msg.create_reaction("👋")
  27.  
  28. # welcome dm message
  29. embed = interactions.Embed(title = f"LawMixer's SCP:F", description = f"Thank you for joining, {member.mention}.", color=0xe79f04)
  30. embed.add_field(name="You will need to verify with RoVer to gain access to our channels, ", value = "<#977296387832168518>", inline=False)
  31. embed.add_field(name = "You have been subscribed to notifications by default", value="You can disable them by doing /subscribe in commands.")
  32. embed.set_thumbnail(url=member.user.avatar_url)
  33. embed.set_footer(text = f"Sent by: LawMixer's SCP:F | Discord ID: {member.id}")
  34.  
  35. button = interactions.Button(label="Roblox Group", style= interactions.ButtonStyle.LINK, url=f"https://www.roblox.com/groups/4800717/SCP-F-Special-Containment-Procedures-Foundation#!/about")
  36. button2 = interactions.Button(label="Application Center", style= interactions.ButtonStyle.LINK, url="https://www.roblox.com/games/7944405760/Application-Center-In-Testing")
  37. button3 = interactions.Button(label="Discord Server", style= interactions.ButtonStyle.LINK, url="https://discord.gg/X33juJwjS6")
  38.  
  39.  
  40.  
  41. try:
  42. await member.send(embeds = embed, components=[button, button2, button3])
  43. except interactions.LibraryException:
  44. print("cannot dm user")
  45. return
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement