-
-
Save jayktaylor/c18ddef3817c58ad1cbb6018d33790eb to your computer and use it in GitHub Desktop.
async def cmd_sendall(self, args, leftover_args): | |
""" | |
Usage: | |
{command_prefix}sendall <message> | |
Sends a message to all servers the bot is on | |
""" | |
if leftover_args: | |
args = ' '.join([args, *leftover_args]) | |
for s in self.servers: | |
await self.safe_send_message(s, args) |
If it doesn't work for you, be sure that the formatting does NOT use TAB and only uses spaces. (In front of async it must be spaces not tab)
Hello, where do I put the code?
The code should be in your bot.py file
Hey, is there a version of the code wich send messages directly into default text channel, without the bindtochannel option?
Thx.
How would I make one that posts in another, specified channel ex:
(in bot channel)
!announce Im cool
(In pre-specified channel)
MusicBot[Bot]
Im cool
How would one go about doing that? I've tried lots of things :/
@EremMc Check out discord.js with NodeJS. Something like that is super easy to do with discord.js.
I'm getting this weird error in terminal: /Farmer#6858: !sendall this is a test WARNING: Cannot send message to "Farmer's Dev Cave", invalid channel?
. The message gets sent to one of the channels the server is one but not the other.
Code is outdated.
Don't use ^^
This code sends a message to every channel the bot is binded to. It's probably really bad code since I suck at Python, but it's been working fine for me. let me know if i fucked something up(which I most likely did lol)