From f7c7247b9204168bc95b7f88ace63cc37ab34934 Mon Sep 17 00:00:00 2001 From: Myned Date: Thu, 14 Jun 2018 21:15:25 -0400 Subject: [PATCH] Fix GoTo breaking in DMs --- src/cogs/booru.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cogs/booru.py b/src/cogs/booru.py index bf96b1a..e72c203 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -833,7 +833,9 @@ class MsG: icon_url=self._get_score(values[c - 1]['score'])) embed.set_image(url=values[c - 1]['file_url']) - await number.delete() + if ctx.channel is d.TextChannel: + with suppress(errext.CheckFailure): + await number.delete() await paginator.edit(content='\N{HEAVY BLACK HEART}' if keys[c - 1] in hearted.keys() else None, embed=embed) @@ -973,7 +975,9 @@ class MsG: icon_url=self._get_score(values[c - 1]['score'])) embed.set_image(url=values[c - 1]['file_url']) - await number.delete() + if ctx.channel is d.TextChannel: + with suppress(errext.CheckFailure): + await number.delete() await paginator.edit(content='\N{HEAVY BLACK HEART}' if keys[c - 1] in hearted.keys() else None, embed=embed)