From 8dee45fbfcffbb20f892462071c4e716f81eab32 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Tue, 16 Jun 2020 01:28:47 +0100 Subject: [PATCH] To flex on Dyno Bot, added my own welcoming message --- EnsoBot.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/EnsoBot.py b/EnsoBot.py index f1e89bc5..aea2ba75 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -1,4 +1,5 @@ import asyncio +import datetime import discord from decouple import config @@ -69,6 +70,40 @@ async def on_command_error(ctx, error): await message.delete() +@client.event +async def on_member_join(member): + channel = client.get_channel(669771571337887765) + + try: + embed = discord.Embed(title="\n**Welcome To Ensō!**", + colour=discord.Colour(0x30e419)) + + embed.timestamp = datetime.datetime.utcnow() + + embed.set_thumbnail(url="https://media.discordapp.net/attachments/683490529862090814/715010931620446269" + "/image1.jpg?width=658&height=658") + embed.set_image( + url="https://cdn.discordapp.com/attachments/714671068941647933/717144047252275270/f4d7de6463d3ada02058a094fd6917ac.gif") + embed.set_footer(text=f"Hamothy#5619", + icon_url="https://media.discordapp.net/attachments/689525645734182916/718510466640642099/Rias_Gremory.png") + embed.add_field( + name="\u200b", + value=f"Hello {member.mention}! We hope you enjoy your stay in this server! ", + inline=False) + embed.add_field( + name="\u200b", + value=f"Be sure to check out our <#669815048658747392> channel to read the rules and <#683490529862090814> channel to get caught up with any changes! ", + inline=False) + embed.add_field( + name="\u200b", + value=f"Last but not least, feel free to go into <#669775971297132556> to introduce yourself!", + inline=False) + + await channel.send(embed=embed) + except Exception as e: + print(e) + + try: client.run(API_TOKEN) except discord.errors.LoginFailure as e: