From f0cbb39d2517ad87deaee64b44a8cde6afc13520 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 10 Oct 2018 19:34:52 -0500 Subject: [PATCH] Send short messages to the channel --- cogs/misc.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cogs/misc.py b/cogs/misc.py index efc1ef8..3cd2807 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -99,13 +99,18 @@ class Miscallaneous: else: chunks[len(chunks) - 1] += tmp + if len(chunks) == 1 and len(chunks[0]) < 1000: + destination = ctx.channel + else: + destination = ctx.author + try: for chunk in chunks: - await ctx.author.send(chunk) + await destination.send(chunk) except (discord.Forbidden, discord.HTTPException): await ctx.send("I cannot DM you, please allow DM's from this server to run this command") else: - if ctx.guild: + if ctx.guild and destination == ctx.channel: await ctx.send("I have just DM'd you some information about me!") @commands.command()