You don't need to do member.create_dm()
because when you DM a user it's not needed.
You also don't need to define description
to None, you simply don't even need to specify a description.
In order for the bot to even find the members, you need members intent turned on in your bot. You can do that using the image below.
Now, you just need to provide the code in the bot so that the bot can use the intents.
Here is the code that you need to add to your main bot file.
intents = discord.Intents.default() # Gets the default intents from discord.
intents.members = True # enables members intents on the bot.
bot = commands.Bot(command_prefix=prefix, intents=intents)
After all of that here is your fixed code.
@bot.event
async def on_member_join(member):
embed = discord.Embed(title="Welcome to my server!", description=None, color = discord.Color.magenta())
embed.add_field(name="To get started:", value="?Invite some friends!
?Check out some of the channels and get engaged with the community!
?Have fun!", inline=True)
await member.send(embed=embed)
I hope this helped, Have a nice day, Best of luck on your bot.
Here is a Discord Server for Beginners.
?? Discord.py For Beginners : https://discord.gg/C8zFM3D2rn
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…