Answer the question
In order to leave comments, you need to log in
Discord.py how to make the BOT send messages to all channels at once?
I need the bot to send out messages to all channels on the server after writing the command. For example, some kind of announcement. As I understand it, you need to make a cycle in which you need to determine the channel IDs, and then send a message to them. But how to implement it?
Answer the question
In order to leave comments, you need to log in
@bot.command(pass_context=True)
async def test(ctx, *, msg):
for server in bot.servers:
for channel in server.channels:
try:
await bot.send_message(channel, msg)
except Exception:
continue
else:
break
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question