0

i made this code to it DM people on join, but whenever someone joins, it does not send it.

@client.command()
async def on_member_join(member):
    embed = discord.Embed(title="idk", description="idk", color=discord.Color.red())
    await member.send(embed=embed)
    print ("Working command.")
Łukasz Kwieciński
  • 14,992
  • 4
  • 21
  • 39
asi
  • 11
  • Does this answer your question? [None of my discord.js guildmember events are emitting, my user caches are basically empty, and my functions are timing out?](https://stackoverflow.com/questions/64559390/none-of-my-discord-js-guildmember-events-are-emitting-my-user-caches-are-basica) – mswgen Jan 18 '22 at 10:12
  • `discord.py` not `discord.js` @mswgen – Łukasz Kwieciński Jan 18 '22 at 10:14
  • @ŁukaszKwieciński it's right. But the problem is actually same(privileged intents). But i thought it might not be a good idea, so i retracted the flag now. – mswgen Jan 18 '22 at 10:16
  • Yes, it's the same concept, but you enable them differently in discord.py – Łukasz Kwieciński Jan 18 '22 at 10:21
  • @ŁukaszKwieciński actually the way to enable it is independent of the library you're using. Check out my answer. – mswgen Jan 18 '22 at 11:41
  • Well you gotta enable them in the code too, that's what I'm talking about. You just showed how to enable them in the developer portal, but without changes in the code it'll do nothing. – Łukasz Kwieciński Jan 18 '22 at 12:02

1 Answers1

0

Guild member related events are privileged intents.

It means that you have to turn it on at your bot page.

enter image description here

User presence related events are also privileged, and message content related events are also privileged after April 30.

mswgen
  • 636
  • 1
  • 9
  • 18