#πŸ”’ Need help making my bot send welcome messages in dms to new members.

26 messages Β· Page 1 of 1 (latest)

lavish maple
#

ive tried googling it but different people use completely different layouts meaning i have to change the whole code, ive currently made the bot online thats it just looking for some help to send embeds to peoples dms when they first join.

dawn sandalBOT
#

@lavish maple

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

lavish maple
winged pilot
lavish maple
#

sorry

lavish maple
lament horizon
# lavish maple discord.py

This might work, just make it so it's to the user dm's not a channel

import discord

client = discord.Client()

@client.event
async def on_message_join(member):
    channel = client.get_channel(channel_id)
    embed=discord.Embed(title=f"Welcome {member.name}", description=f"Thanks for joining {member.guild.name}!") # F-Strings!
    embed.set_thumbnail(url=member.avatar_url) # Set the embed's thumbnail to the member's avatar image!

    await channel.send(embed=embed)```
winged pilot
dawn sandalBOT
#

discord.on_member_join(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member) joins a [`Guild`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild).

This requires [`Intents.members`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Intents.members) to be enabled.
lament horizon
winged pilot
lament horizon
winged pilot
#

also btw member_url might be None because it doesnt include discord's default profiles

#

kek

lament horizon
#

Or I don't see it

#

There's embed.set_thumbnail(url=member.avatar_url)

url=member.avatar_url

#

All o know it works for me

winged pilot
#

what lib do you use?

dawn sandalBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.