T
T
TheFlamer2021-06-17 12:52:27
Python
TheFlamer, 2021-06-17 12:52:27

How to send message to all people on server in pm discord.py?

Tried like this: ( How to make the discord bot write in private messages to everyone who is on the discord server with it, and all this with one command? )

@bot.command()
async def message_all(ctx):
    for guild in bot.guilds:
        for member in guild.members:
             await member.send("Приветики!")
             print("Отправил " + str(member))

Didn't work, can you help?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-06-17
@Vindicar

Are the bots given permission to do this? Are intents appropriately requested?
In general, for this, I would have thrown the bot out of my server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question