Nicholas Chen
Nicholas Chen

Reputation: 144

Discord.py on_member_join not responding

I am using a @client.event function for my on_member_join event. I would like it to send a message upon a user joining, however, there are no responses nor errors from the console.

Here is my current attempted code

@client.event
async def on_member_join(member):
    await member.send(
        "<a:welcome1:805857483473027122><a:welcome2:805857477375164468> \n<a:tysm:805858522578812930>"
    )

Upvotes: 0

Views: 72

Answers (1)

Cohen
Cohen

Reputation: 2415

Events related to members or on_member_join event, will require the special member intents to be enabled in the developer portal as well as defined in your code.

After enabling the intents in the bot section of the portal, copy this into your code to use the special member_intents module

intents = discord.Intents.default()
intents.members = True

client = commands.Bot(command_prefix='Prefix', intents=intents)

Upvotes: 1

Related Questions