From 2334c95d8781df829ac2ec1a1c5abb2b4d776586 Mon Sep 17 00:00:00 2001 From: Den4200 Date: Tue, 30 Mar 2021 16:06:23 -0400 Subject: Gracefully handle failure to upload to hastebin in `!dmrelay`. --- bot/exts/moderation/dm_relay.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bot/exts/moderation/dm_relay.py b/bot/exts/moderation/dm_relay.py index 68a48c67c..1d2206e27 100644 --- a/bot/exts/moderation/dm_relay.py +++ b/bot/exts/moderation/dm_relay.py @@ -55,6 +55,11 @@ class DMRelay(Cog): ) paste_link = await send_to_paste_service(metadata + output, extension="txt") + + if paste_link is None: + await ctx.send(f"{Emojis.cross_mark} Failed to upload output to hastebin.") + return + await ctx.send(paste_link) async def cog_check(self, ctx: Context) -> bool: -- cgit v1.2.3