From fabfa9074e76b5e8577b1fc068fbb02627ff9577 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Fri, 19 Aug 2022 10:27:12 +0100 Subject: Update bookmark error handling This moves sending the error response to within the except block, making it easier to parse what the code is doing. --- bot/exts/utilities/bookmark.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/exts/utilities/bookmark.py b/bot/exts/utilities/bookmark.py index 58f3044c..70175c80 100644 --- a/bot/exts/utilities/bookmark.py +++ b/bot/exts/utilities/bookmark.py @@ -74,10 +74,9 @@ class Bookmark(commands.Cog): await member.send(embed=embed) except discord.Forbidden: error_embed = self.build_error_embed(f"{member.mention}, please enable your DMs to receive the bookmark.") + await channel.send(embed=error_embed) else: log.info(f"{member} bookmarked {target_message.jump_url} with title '{title}'") - return - await channel.send(embed=error_embed) @commands.group(name="bookmark", aliases=("bm", "pin"), invoke_without_command=True) @commands.guild_only() -- cgit v1.2.3