From 1d859e09955240c6c5bd62124dea7bdae72d2786 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 5 May 2017 15:53:12 -0500 Subject: [PATCH] Add a command to send a message to a particular channel --- cogs/owner.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cogs/owner.py b/cogs/owner.py index 80ce6a0..4bc3206 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -140,6 +140,17 @@ class Owner: await utils.update_content('motd', entry, key) await ctx.send("New motd update for {}!".format(date)) + @commands.command() + @commands.check(utils.is_owner) + async def sendtochannel(self, ctx, cid, message): + """Sends a message to a provided channel, by ID""" + channel = self.bot.get_channel(cid) + await channel.send(message) + try: + await ctx.message.delete() + except discord.Forbidden: + pass + @commands.command() @commands.check(utils.is_owner) async def debug(self, ctx, *, code: str):