1

I've been trying to send a DM to all members of a guild, but I always get this error:

AttributeError: 'ClientUser' object has no attribute 'create_dm'

This is my code

@bot.command()
async def send(ctx, *, message):
    for member in ctx.guild.members:
        channel = await member.create_dm()
        channel.send(message)
    await ctx.send('Messages successfully sent!')

What am I doing wrong?

HoneyPoop
  • 473
  • 1
  • 6
  • 25

1 Answers1

2

I figured it out, I have to await the channel.send

HoneyPoop
  • 473
  • 1
  • 6
  • 25