From b2dc7a168b76dd33c9296d06f572fb926cca722b Mon Sep 17 00:00:00 2001 From: sgoudham Date: Mon, 24 Aug 2020 23:32:42 +0100 Subject: [PATCH] Error handling for instagram api command --- cogs/fun.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/fun.py b/cogs/fun.py index fec4f40a..c4ec45d7 100644 --- a/cogs/fun.py +++ b/cogs/fun.py @@ -368,6 +368,10 @@ class Fun(Cog): uploads = data["uploads"]["count"] biography = data["biography"] + elif response.status == 422: + await self.bot.generate_embed(ctx, desc="**Instagram Username Not Found!**") + return + # Setting bools to ticks/cross emojis verif = self.bot.tick if verified else self.bot.cross priv = self.bot.tick if private else self.bot.cross