From 7f390df8795bca69239d0c8c1381488f6f64e877 Mon Sep 17 00:00:00 2001 From: Stonedestroyer <1307729+Stonedestroyer@users.noreply.github.com> Date: Sun, 19 Jan 2020 18:08:31 +0100 Subject: [PATCH] [Customcom] Fix error on exiting customcom interactive menu. (#3417) * [Customcom] Fixes error on exit * Changelog * Fixed spelling. * Typehinting --- changelog.d/customcom/3416.bugfix.rst | 1 + redbot/cogs/customcom/customcom.py | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changelog.d/customcom/3416.bugfix.rst diff --git a/changelog.d/customcom/3416.bugfix.rst b/changelog.d/customcom/3416.bugfix.rst new file mode 100644 index 000000000..672d5f032 --- /dev/null +++ b/changelog.d/customcom/3416.bugfix.rst @@ -0,0 +1 @@ +Fixes error on exiting customcom interactive menu. \ No newline at end of file diff --git a/redbot/cogs/customcom/customcom.py b/redbot/cogs/customcom/customcom.py index 5b163f046..b9c674559 100644 --- a/redbot/cogs/customcom/customcom.py +++ b/redbot/cogs/customcom/customcom.py @@ -227,6 +227,9 @@ class CustomCommands(commands.Cog): await ctx.send(_("There already exists a bot command with the same name.")) return responses = await self.commandobj.get_responses(ctx=ctx) + if not responses: + await ctx.send(_("Custom command process cancelled.")) + return try: await self.commandobj.create(ctx=ctx, command=command, response=responses) await ctx.send(_("Custom command successfully added."))