Getting rid of Try/Except in the on_member_join event

pull/4/head
sgoudham 4 years ago
parent 76d4305dda
commit 7d35a0e453

@ -56,45 +56,39 @@ async def on_member_join(member):
server_icon = "https://media.discordapp.net/attachments/683490529862090814/715010931620446269/image1.jpg?width=658&height=658" server_icon = "https://media.discordapp.net/attachments/683490529862090814/715010931620446269/image1.jpg?width=658&height=658"
welcome_gif = "https://cdn.discordapp.com/attachments/714671068941647933/717144047252275270/f4d7de6463d3ada02058a094fd6917ac.gif" welcome_gif = "https://cdn.discordapp.com/attachments/714671068941647933/717144047252275270/f4d7de6463d3ada02058a094fd6917ac.gif"
# Surround with try/except to catch any exceptions that may occur # Set up embed for the #newpeople channel
try: embed = Embed(title="\n**Welcome To Ensō!**",
colour=Colour(0x30e419),
# Set up embed for the #newpeople channel timestamp=datetime.datetime.utcnow())
embed = Embed(title="\n**Welcome To Ensō!**",
colour=Colour(0x30e419), embed.set_thumbnail(url=server_icon)
timestamp=datetime.datetime.utcnow()) embed.set_image(url=welcome_gif)
embed.add_field(
embed.set_thumbnail(url=server_icon) name="\u200b",
embed.set_image(url=welcome_gif) value=f"Hello {member.mention}! We hope you enjoy your stay in this server! ",
embed.add_field( inline=False)
name="\u200b", embed.add_field(
value=f"Hello {member.mention}! We hope you enjoy your stay in this server! ", name="\u200b",
inline=False) value=f"Be sure to check out our <#669815048658747392> channel to read the rules and <#683490529862090814> channel to get caught up with any changes! ",
embed.add_field( inline=False)
name="\u200b", embed.add_field(
value=f"Be sure to check out our <#669815048658747392> channel to read the rules and <#683490529862090814> channel to get caught up with any changes! ", name="\u200b",
inline=False) value=f"Last but not least, feel free to go into <#669775971297132556> to introduce yourself!",
embed.add_field( inline=False)
name="\u200b",
value=f"Last but not least, feel free to go into <#669775971297132556> to introduce yourself!", # Send embed to #newpeople
inline=False) await new_people.send(embed=embed)
# Send embed to #newpeople # Set hamothyID equal to my id in discord
await new_people.send(embed=embed) hamothyID = '<@&715412394968350756>'
# Set hamothyID equal to my id in discord # String for welcoming people in the #general channel
hamothyID = '<@&715412394968350756>' general_welcome = f"Welcome to the server! {member.mention} I hope you enjoy your stay here <a:huh:676195228872474643> <a:huh:676195228872474643> " \
f"\nPlease go into <#722347423913213992> to choose some ping-able roles for events! " \
# String for welcoming people in the #general channel f"\nPlease ping {hamothyID} for any questions about the server and of course, the other staff members!"
general_welcome = f"Welcome to the server! {member.mention} I hope you enjoy your stay here <a:huh:676195228872474643> <a:huh:676195228872474643> " \
f"\nPlease go into <#722347423913213992> to choose some ping-able roles for events! " \ # Send welcome message to #general
f"\nPlease ping {hamothyID} for any questions about the server and of course, the other staff members!" await general.send(general_welcome)
# Send welcome message to #general
await general.send(general_welcome)
except Exception as ex:
print(ex)
# Allowing people to get ping-able self roles # Allowing people to get ping-able self roles

Loading…
Cancel
Save