0
votes

I was writing welcome message code but whenever I run the bot and member joins the embed doesn't show up and it also doesn't show any error. How should I fix it?

async def on_member_join(member):
    channel = bot.get_channel(ID)
    embed = discord.Embed(description = f"Welcome {member.mention}", color=0xE74C3C)
    await channel.send(embed=embed)
2

2 Answers

0
votes

You need to enable the intents

intents = discord.Intents().all()
`client = commands.Bot(command_prefix=prefix, intents=intents)
0
votes

intents = discord.Intents.default()
intents.members = True
intents = Intents.all()
client = commands.Bot(command_prefix="ur prefix", intents=intents)

@client.event
async def on_member_join(member):
    if member.guild.name == 'server name here':  #type your server name
        embed = discord.Embed(title=f'welcome {member.name} !\nwelcome to {member.guild.name} go see #✨how-roles-work and #✨rules ',
                    color=0x0061ff,
                    font_size=200)
        await client.get_channel(755836023069474947).send(f"{member.mention}")
        await client.get_channel(755836023069474947).send(embed=embed)
        role = discord.utils.get(member.guild.roles, name="Community")
        await member.add_roles(role)
    #elif member.guild.name == "Kodik's Editing Server":
       # embed = discord.Embed(title=f'welcome {member.name} !\nwelcome to #{member.guild.name}',
                    #color=0x0061ff)  #you can add more if you want 
        #await client.get_channel(782213231900491796).send(embed=embed)
    else:
        return