Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. class Welcome(commands.Cog):
  2. def __init__(self, bot):
  3. self.bot = bot
  4.  
  5.  
  6. @commands.Cog.listener()
  7. async def on_member_join(self, user: discord.Member):
  8. guildName = user.guild.name
  9. channel = self.bot.get_channel(555844758778544160)
  10. embed = discord.Embed(colour=discord.Color(random.randint(0x000000, 0xFFFFFF)))
  11. embed.title = "Hello {}, welcome to {}!".format(user, guildName)
  12. embed.description = "Before you continue we just want to make sure you have read up on our all important group guidelines. if you haven't you can find them in <#546694486391128066>. Once you're satified with them go ahead and give my message a :thumbsup:."
  13. embed.set_image(url='')
  14. msg = await channel.send(embed=embed)
  15. await msg.add_reaction(thumbs_up) # todo: make bot set a thumbs_up emoji but only set members role when the user mentioned reacts.
  16. await self.bot.wait_for('reaction_add', check=react_check(user, msg, thumbs_up))
  17. role = get(user.guild.roles, name="Members")
  18. if self.bot: #supposed check to see if the bot
  19. pass
  20. else:
  21. await user.add_roles(role)
  22. await channel.send(':thumbsup: Awesome! you're now set to go. If you would like to add some roles head over to <#555913791615926302> for more details. ')# Check
  23.  
  24. def setup(bot):
  25. bot.add_cog(Welcome(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement