From 36d34b4079c65c07f3fa5c2ce8b3cfd3a8377efb Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 23 Jul 2020 08:30:00 +0100 Subject: [PATCH] Making sure the command can be used within dms --- cogs/test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cogs/test.py b/cogs/test.py index b05dcf25..f82d44ce 100644 --- a/cogs/test.py +++ b/cogs/test.py @@ -25,10 +25,13 @@ class helper(commands.Cog, command_attrs=dict(hidden=True)): colour=enso_embedmod_colours, timestamp=datetime.datetime.utcnow()) coggers.set_footer(text=f"Requested by {ctx.author}", icon_url='{}'.format(ctx.author.avatar_url)) - coggers.set_thumbnail(url=ctx.guild.icon_url) + if ctx.message.guild is None: + coggers.set_thumbnail(url=ctx.author.avatar_url) + else: + coggers.set_thumbnail(url=ctx.guild.icon_url) cog_desc = '' for x in self.bot.cogs: - cog_desc += f"**{x}** - {self.bot.cogs[x].__doc__}\n" + cog_desc += f"**{x}** | {self.bot.cogs[x].__doc__}\n" coggers.add_field(name=blank_space, value=cog_desc[0:len(cog_desc) - 1], inline=False) await ctx.message.add_reaction(emoji="✉️") await ctx.send(embed=coggers)