Skip to content

Instantly share code, notes, and snippets.

@jayktaylor
Created October 3, 2016 15:04
Show Gist options
  • Save jayktaylor/c18ddef3817c58ad1cbb6018d33790eb to your computer and use it in GitHub Desktop.
Save jayktaylor/c18ddef3817c58ad1cbb6018d33790eb to your computer and use it in GitHub Desktop.
MusicBot - Send all command
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)
@EremMc
Copy link

EremMc commented Nov 10, 2017

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 :/

@max-bromberg
Copy link

@EremMc Check out discord.js with NodeJS. Something like that is super easy to do with discord.js.

@johannesfk
Copy link

johannesfk commented Jan 10, 2018

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.

@amit177
Copy link

amit177 commented Jan 17, 2018

Code is outdated.
Don't use ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment