Answer the question
In order to leave comments, you need to log in
How to send a message to everyone on a discord server at once in python?
I've been trying to do it for a long time, it doesn't work. I am new to python
Answer the question
In order to leave comments, you need to log in
1. Write a message to a channel that is available to all users. This is the best solution in most cases. You can use mentions (@here, @everyone, @role).
2. Use a loop through the list of users. If the messages are the same, then this is not a good solution. Also, not all users can allow receiving messages from third-party contacts (we are getting ready to catch exceptions). Plus, flooding in LAN is not very good in principle, especially if there are a lot of users (we are getting ready to make delays so as not to exceed the speed). You also need to pay attention to the fact that by default the bot does not have the right to receive a list of all server users via the API, this must be explicitly enabled, see https://discordpy.readthedocs.io/en/stable/intents.html
In JavaScript, all declared variables seem to be placed at the beginning of the scope.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question