1
0
Fork 0
mirror of synced 2024-05-27 07:49:42 +12:00

Send short messages to the channel

This commit is contained in:
phxntxm 2018-10-10 19:34:52 -05:00
parent f0ddede3c4
commit f0cbb39d25

View file

@ -99,13 +99,18 @@ class Miscallaneous:
else: else:
chunks[len(chunks) - 1] += tmp chunks[len(chunks) - 1] += tmp
if len(chunks) == 1 and len(chunks[0]) < 1000:
destination = ctx.channel
else:
destination = ctx.author
try: try:
for chunk in chunks: for chunk in chunks:
await ctx.author.send(chunk) await destination.send(chunk)
except (discord.Forbidden, discord.HTTPException): except (discord.Forbidden, discord.HTTPException):
await ctx.send("I cannot DM you, please allow DM's from this server to run this command") await ctx.send("I cannot DM you, please allow DM's from this server to run this command")
else: else:
if ctx.guild: if ctx.guild and destination == ctx.channel:
await ctx.send("I have just DM'd you some information about me!") await ctx.send("I have just DM'd you some information about me!")
@commands.command() @commands.command()