on_member_join only affects Enso

pull/4/head
sgoudham 4 years ago
parent b816124ee7
commit 08d4a6ae8f

@ -5,7 +5,6 @@ import discord
from decouple import config from decouple import config
from discord import Embed, Colour from discord import Embed, Colour
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import is_owner
import settings import settings
@ -49,7 +48,7 @@ async def on_ready():
# Bot ~Ping command in milliseconds # Bot ~Ping command in milliseconds
@client.command(name="ping", aliases=["Ping"]) @client.command(name="ping", aliases=["Ping"])
@is_owner() @commands.is_owner()
async def ping(ctx): async def ping(ctx):
"""Send the latency of the bot (ms)""" """Send the latency of the bot (ms)"""
await ctx.send(f'Ping Pong! {round(client.latency * 1000)}ms') await ctx.send(f'Ping Pong! {round(client.latency * 1000)}ms')
@ -59,34 +58,38 @@ async def ping(ctx):
@client.event @client.event
async def on_member_join(member): async def on_member_join(member):
# Set the channel id to "newpeople" # Set the channel id to "newpeople"
new_people = client.get_channel(669771571337887765) guild = member.guild
if guild.id == 663651584399507476:
# Set the enso server icon and the welcoming gif return
server_icon = "https://media.discordapp.net/attachments/683490529862090814/715010931620446269/image1.jpg?width=658&height=658" else:
welcome_gif = "https://cdn.discordapp.com/attachments/714671068941647933/717144047252275270/f4d7de6463d3ada02058a094fd6917ac.gif" new_people = guild.get_channel(669771571337887765)
# Set up embed for the #newpeople channel # Set the enso server icon and the welcoming gif
embed = Embed(title="\n**Welcome To Ensō!**", server_icon = "https://media.discordapp.net/attachments/683490529862090814/715010931620446269/image1.jpg?width=658&height=658"
colour=Colour(0x30e419), welcome_gif = "https://cdn.discordapp.com/attachments/714671068941647933/717144047252275270/f4d7de6463d3ada02058a094fd6917ac.gif"
timestamp=datetime.datetime.utcnow())
# Set up embed for the #newpeople channel
embed.set_thumbnail(url=server_icon) embed = Embed(title="\n**Welcome To Ensō!**",
embed.set_image(url=welcome_gif) colour=Colour(0x30e419),
embed.add_field( timestamp=datetime.datetime.utcnow())
name="\u200b",
value=f"Hello {member.mention}! We hope you enjoy your stay in this server! ", embed.set_thumbnail(url=server_icon)
inline=False) embed.set_image(url=welcome_gif)
embed.add_field( embed.add_field(
name="\u200b", 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! ", value=f"Hello {member.mention}! We hope you enjoy your stay in this server! ",
inline=False) inline=False)
embed.add_field( embed.add_field(
name="\u200b", name="\u200b",
value=f"Last but not least, feel free to go into <#669775971297132556> to introduce yourself!", 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) inline=False)
embed.add_field(
# Send embed to #newpeople name="\u200b",
await new_people.send(embed=embed) value=f"Last but not least, feel free to go into <#669775971297132556> to introduce yourself!",
inline=False)
# Send embed to #newpeople
await new_people.send(embed=embed)
# Bot Event for handling all errors within discord.commands # Bot Event for handling all errors within discord.commands

Loading…
Cancel
Save