[Python] Discord.py dmall command

Discussão em 'Python' iniciado por Stack, Janeiro 19, 2025.

  1. Stack

    Stack Membro Participativo

    I was making a dmall command and for the ctx.members it says unexpected intended block.
    How do i fix this

    @bot.command()
    async def dmall(ctx, *, message):


    Get the list of all members in the server

    members =ctx.guild.members


    Loop through each member and send a DM

    for member in members:

    try:
    await member.send(message)
    print(f"Sent a DM to {member.name}
    #{member.discriminator}")

    except:
    print(f"Failed to send a DM to
    {member.name}#{member.discriminator}")
    await ctx. send("DMs sent to all members!")

    Continue reading...

Compartilhe esta Página